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.
To overcome the electrostatic repulsion of hydrogen nuclei, high pressure and temperature are needed. These conditions occur in the core of the Sun.