Super Mario Galaxy
Fire Cannons appear in Bowser's Star Reactor, Deep Dark Galaxy, Toy Time Galaxy, and in Undergrunt Gunner Planet. There are two variants of this obstacles. One that emits flames, and the other shoots fireballs.
Super Mario Galaxy 2
Fire Cannons reappear in this game, in Bowser's Galaxy Generator. Notably, the game only features those which shoot out fireballs.