From the Super Mario Wiki
In Donkey Kong 64, Peanuts are used as ammunition for Diddy Kong's Peanut Popguns, and can be found scattered around the world in boxes. In Super Smash Bros. Brawl, a shelled peanut will sometimes appear when Diddy Kong uses his Peanut Popgun. This will recover a small amount of health if eaten. Other than that, the peanut doesn't do much else.
In The Super Mario Bros. Super Show! live-action segment "Two Bums from Brooklyn", Tommy Lasagna offered Mario and Luigi with a job of throwing peanuts at Brooklyn Dodgers baseball games, due to the fact that their skills weren't good enough to make his team. He threw each of them a bag of peanuts, which they proceeded to eat.