It can often be considered closed for the purposes of the phenomenon that we want to describe. To be specific, masses like galaxies, stars and planets accelerate all parts of our tiny rocket the same way. Yes, there are differences, but they are usually so small that they can be neglected. Our rocket works mostly the same no matter how it is oriented to these sources of gravity. Of course, as it gets closer to such masses, these forces (called tidal forces) start to matter and will eventually rip it apart, given that it doesn't burn up or collide first.
Rockets, differently to balloons, do not depend on an interaction with a gravitic field for their operation. They work by ejecting reaction mass opposite to the flight direction and relying on Newton's third law of motion. Most of the time, the energy to eject the reaction mass is generated by combustion, but it doesn't really matter. Rockets can also be driven by the reaction mass's pressure inside its tank.
In general, any system can be turned into a closed system by including all sources of force in the description. Of course, the more forces are included in our model, the less useful it gets. Therefore, physicists and engineers must decide which forces can be ignored. Else, even experiments would become useless because without a model, the experience gained from experiments cannot be generalized.