The sun is made of fire but fire needs oxygen right? So..
Why can there be flames in space, while there's no oxygen?
Same idea as with the rocket engines of the spaceship, which also produce fire while there's no oxygen?
The Sun isn't "made of fire". It's made mostly of hydrogen and helium. Its heat and light come from nuclear fusion, a very different process that doesn't require oxygen. Ordinary fire is a chemical reaction; fusion merges hydrogen nuclei into helium, and produces much more energy. (Other nuclear reactions are possible.)
As for rockets, they carry both fuel and oxygen (or another oxidizer) with them (at least chemical rockets do; there are other kinds). That's the difference between a rocket engine and a jet engine; jets carry fuel, but get oxygen from the air.
This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.