Rockets do not need air to fly like and airplane does. In fact, it will work better in outer space where there is no air. Air creates friction against the rocket and slows it down. At higher altitudes the air gets thinner. In outer space there is almost no friction to slow the rocket down.
Rockets do well in outer space for another reason.
To burn, fuel must combine with a chemical called oxidizer. Oxygen is the most common oxidizer. There are large amounts of oxygen in the air. An airplane takes in oxygen and uses it to burn its fuel. They do not need to rely on oxygen from the air.