The Sun does not "burn", like we think of logs in a fire or paper burning. The Sunglows because it is a very big ball of gas, and a process called nuclear fusion is taking place in its core. ... Hydrogen really doesn't burn, it fuses, into helium. So no oxygen is required!
So, the Sun can "burn" hydrogen to helium without the need for oxygen. It should be noted that in the presence of carbon, nitrogen and oxygen, stars heavier than theSun may burn hydrogen to helium by using the C, N and O as catalysts. Even in these stars, however, an absence of oxygen does not prevent nuclearburning.