From the Super Mario Wiki
A Garlic Dispenser is a support object in Wario World. It sells Wario garlic, which heals him. A Garlic Dispenser looks like a red vending machine with a face and a giant clove of garlic on its head. When approaching one, it will make alluring gestures, trying to convince Wario to spend his money.
When Wario punches one, he'll receive some Garlic in exchange for some of his coins. However, for each subsequent clove he buys, the price will go up by either 5 or 10 coins, depending on the level. Also, sometimes the price may stay consistent.