It is not possible to buy gold bars with in-game money on My Little Farmies. However, you start off with a few gold bars on your account and you might also gain some by completing story-tasks, via a booster, or by leveling up.
Of course you may also buy them in the bank (treasure chest in the top menu bar) in exchange for real money - check it out, you might just be able to profit from one of our bonuses!