From the Super Mario Wiki
Vegetables (also known as Veggies) are plants that are found in the Real World, yet can be planted in Mushroom Kingdom and Subcon. They can be pulled out of the ground and can be thrown at enemies to damage or defeat them. They are first introduced in Yume Kojo: Doki Doki Panic (a Turnip only) and the Mario game, Super Mario Bros. 2.
Super Mario series
Super Mario Bros. 2
Vegetables are found in Subcon in the game Super Mario Bros. 2. They can be plucked with the B button and thrown at enemies. There are two kinds, unripe and ripe. The ripe ones are much larger than the unripe but they're still just as effective when throwing. Almost all the red grass in the game is a vegetable when plucked. Some of the ideas for what kinds of vegetables they are is turnips, onions, beets, radishes, and other root vegetables.
These are the only effective weapon against the evil Wart in the last level. The pale vegetable in the bottom right side of the picture to the left is only seen when thrown out of Wart's Nightmare Machine.
BS Super Mario USA
Vegetables returned back in the game BS Super Mario USA. They are used in the same manner in the predecessor. The game introduces giant vegetables that can't be picked up. Instead, these giant plants only appear as spells cast by a character who appears on the screen as a card.
Super Mario Advance 4: Super Mario Bros. 3
Using e-Cards, vegetables can be brought into Super Mario Advance 4: Super Mario Bros. 3 thanks to the Blue Green Switch. They can be used in the same manner. The game also features pickable giant vegetables, which first appeared in Super Mario Advance.
The Super Mario Bros. Super Show!
Vegetables appeared in some episodes of The Super Mario Bros. Super Show!. Mario and Luigi use them in various episodes to defeat their enemies, the Koopa Pack and King Koopa like in Super Mario Bros. 2. The vegetable-throwing sound from Super Mario Bros. 2 is also commonly used in the show even for things such as the firing of a Bullet Bill and the throwing of a fireball.
Mario vs. Wario
Vegetables were given a minor appearance in one of the Mario vs. Wario comics. The first page of this comic showed Mario recalling "playing in the garden" with Wario when the two were friends; during this scene, several vegetables are present and Wario even picks one up Super Mario Bros. 2-style. Wario, too, remembers this garden scene on the next page, although his memory is a bit less fair: He recalls Mario asking for help in the garden and taking a row of turnips as his own, leaving Wario to tackle the Piranha Plants on his own.
Super Smash Bros. Melee
In Super Smash Bros. Melee, Princess Peach can also throw these items as her down & B attack, which itself is called "Vegetable". Almost every one she plucks has a different expression and pertains to the amount of damage it will inflict. There is also a Vegetable trophy.
Super Smash Bros. Brawl
Peach's Vegetable move re-appeared in Super Smash Bros. Brawl. The damage of the Vegetables arrange from 1% damage to a one-hit KO. The highest damage is around 40%. Peach can also pluck up Beam Swords, Mr. Saturns, and even Bob-ombs.
Another type of vegetables are food items that are only found in the stage Summit. When they are picked up and eaten they make a special, different sound effect from the other foods.
Mario & Luigi: Bowser's Inside Story
In the boss battle with Wiggler in Mario & Luigi: Bowser's Inside Story, the Wiggler may water the ground and some sprouts will grow. Two of the three possible things he pulls out are ripe and unripe turnips.
Names in other languages