From the Super Mario Wiki
The Flying Pizza was a spaceship that was once used by Mario, Luigi, Princess Toadstool and Toad, in The Super Mario Bros. Super Show! episode "Star Koopa". How Mario's group got hold of the Flying Pizza in the first place was never explained.
The Flying Pizza was originally intended to transport Mario and his friends to the Mushroom Colonists' Planet, so that they could save the Mushroom Colonists from the wrath of Darth Koopa, who had plans to destroy their planet. However, Mario's plans were aborted when the Flying Pizza was spotted by Darth Koopa and Mouser, who were aboard Koop Star. Although Mario attempted to outfly Koop Star in the Flying Pizza, Koop Star proved to be faster, and succeeded in pulling the Flying Pizza into its docking bay via a tractor beam.
With the Flying Pizza onboard Koop Star, Darth Koopa ordered his Stormtroopas to seize everyone inside the Flying Pizza. When they entered, the Stormtroopas duelled Mario's group inside the Flying Pizza with Lightplungers, with Mario's group the victor. However, Darth Koopa boarded the Flying Pizza and challenged Mario to a Lightplunger duel. Although Mario appeared to have won the duel, Darth Koopa retaliated by freezing Mario and his friends with a Freeze Gun, only to have them transported into Koop Star.
Due to the fact that Mario's group never made it back to the Flying Pizza, the ship was presumably destroyed along with Koop Star when it was blown up by Mario's specially planted Bob-omb.