for continuity purposes, i'd recommend getting SMG1, where everything is introduced.
although for Galaxy 2, Nintendo did a nice thing and made it like everyone forgot each other (characters you met in the first game will reintroduce themselves in the second) and made it as if the first game never existed.
if you don't care about how it continues, get SMG2, as it's just like an improved Super Mario Galaxy, making absolutely NO direct references to the first game, so you don't need to play 1 to understand 2. Plus you can ride Yoshi in this one, there is a lot more Power Stars for you to get, and there is a certain galaxy that pays homage to Super Mario 64.
i have both, and love them. :D