There is a very significant difference between the examples of the
cannon and the rocket. With the cannon, the force (thrust) lasts a very
short time whereas the rocket engine force (momentum thrust) is continuous.
To make them more similar, imagine the cannon being fired so rapidly
that there is no time interval between firings. The cannon now moves
backward continuously from the uninterrupted firing (explosion of gases)
and expelling of the cannon balls.
Similarly, the thrust for a rocket continues as long as the engines
are firing because new propellant (mass) from the tanks is continually
being expelled.