When the gas comes out the tail if the rocket it does not need to push against anything. It's not like a bird or jet that is moving air to push itself forward. A rocket is a chemical reaction that creates it's own gas. The gas moving in one direction pushes the rocket in the other. Equal and opposite.
gas coming out the tail of a rocket is the same effect as a bullet coming out the barrel of a gun.
recoil.
A rocket would work if it fired bullets and yes guns do work in space even. The gas escaping pushes against the rocket. Gas goes in direction A Rocket goes in opposite direction B. Equal and opposite reaction. The mass of the rocket (and remaining fuel) is what the gas produced by the fuel pushes against not the vacuum of space. You have to think of every part of the rocket as separate not one object pushing against space.