They wouldn't put Sonic in any Mario games because that is really the whole point of the "Sonic and Mario" series. They'd branch that franchise out before they bring Sonic into enough Mario games and vice versa to make it redundant.
Also, Sonic's speed would not function in the kind of physics Super Mario Galaxy featured. Mario's movements are all so much more precise, and even ice-shoed Luigi would be easier than moving around with Sonic. Also, Sonic's trademark moves are, a dash (whether a spindash, drift, kick, rolling spin, he's always had it), a jump dash or homing attack (he's had it or something similar in every game since Sonic Adventure, and even then it was in Sonic 3 in the form of the fire shield), and the ability to gain speed.
The physics of Super Mario Galaxy are not designed for a very fast paced character. Play against cosmic luigi and you'll find that the game doesn't exactly offer much in terms of speed and the levels aren't really designed for it anyway. Just imagine how frustrating it would be balancing on those moving platforms in Toy Time or running on the narrow walkways in Space Junk as Sonic.