How does the Sun burn without oxygen?
It might not be burning but a big part of the society speaks of it as burning.
So how does it work?
As you are suspecting, the sun burns in a different sense, not by chemical reaction with oxygen.
Atoms consist of a tiny, heavy nucleus, surrounded by an almost empty space, populated by electrons. Burning by chemical reaction with oxygen doesn't change the nucleus of atoms, but takes place in the hull of atoms: Atoms may assemble to form molecules; electrons change their orbitals (the way they surround the nucleus), and release some energy as heat.
Atomic nuclei are (positively) electrically charged, and repell each other. But if small nuclei, like those of hydrogen atoms, come close together, they can fuse and form a larger nucleus. This nuclear fusion of hydrogen to helium (in this case) releases much energy, more even than fission of uranium in a nuclear power plant. The notion "burning" is used sometimes for reactions of atomic nuclei, too, if they release energy as heat.
The sun is a big ball of hydrogen atoms, that get compressed together due to a huge gravitational force. We start off with 4 H atoms:
P-e, P-e, P-e, P-e (note: P=proton, e=electron)
Now, when a proton (P) and electron (e) fuse together, they simply combine into a neutron (note: neutron=N). So, if two of those P-e pairs fuse into a neutron, we now have:
N, N, P-e, P-e
Two neutrons, two protons, two electrons. The 4 hydrogen atoms have become a single helium atom. But wait... the mass went on a diet! If we "weighed" the 4 hydrogen atoms, their total mass was = 4(1.004u) = 4.016u. But the end result, a single helium atom, is only 4.003u.
So, from 4 hydrogens to 1 helium, some "weight" was lost, or more exactly, some of the mass converted into energy. How much energy? This much energy:
The gravitational pull of the Sun is so big, that it fuses hydrogen to helium-2. Helium-2 is unstable and decays to H-2 through the weak interaction. This releases energy in form of heat. Now again the gravitational pull of the sun is so big that it fuses H-2 to He-4 through the strong interaction. This releases energy in form of heat.