The cool thing is that the sun doesn't really "burn" like fire does!
You're right that fires require oxygen as a reactant, but the sun runs on nuclear fusion. Nuclear fusion is the joining of atomic nuclei together and it's possible because of the high temperature and pressure in the sun's core. In the core, hydrogen nuclei fuse with other hydrogen nuclei to form helium (and this can happen with heavier and heavier nuclei with even more pressure and temperature) and photons, basically.
Additionally, one of the products of stellar fusion processes is oxygen, which is then used as an intermediate(catalyst) in further production of helium nuclei(wiki: the CNO cycle).
So if one is so inclined as to call fusion "burning", then we have to admit that oxygen IS used in at least some "burning" in stars.