Yeah, as others have said, the sun isn't burning in the same way as would happen if you lit a flask of hydrogen. It's basically a nuclear fusion reactor with hydrogen as its fuel, which it converts into heavier elements (mostly helium) by fusing hydrogen atoms together. When that happens, there is a bit of energy left over, which is radiated as heat and light. (obviously it's all a bit more complicated than that, but that's the basic idea)
Interestingly, if you had an environment of 100% hydrogen, you wouldn't be able to ignite it, as you need oxygen for that kind of reaction. There's a moon (of Jupiter, I think, but I'm a bit hazy) where the atmosphere is mainly methane, but you wouldn't be able to light it as there is little or no oxygen there.