The Sun is an Amazing source of energy and people have long wondered how all that energy os produced. The word burning usually means combustion and if the Sun was burning this way, it would indeed need oxygen.
We’re certain this isn’t the case because the Sun wouldn’t last for long. Nuclear reactions are the only source of energy able to keep the Sun shining for at least the age of the solar system and keeping us warm on a good day.
When physicists say a star is burning hydrogen, they mean it’s joining hydrogen atoms together to obtain helium and release energy. The exact name for this process is nuclear fusion.
There is no need for oxygen in these nuclear reactions but with respect to tradition, and as it sounds better, astrophysicists use the word burn. This means that you can use it as well if you want to sound like a pro…just remember the explanation to back it up.