It is possible because the Smeargle Sketched the move Bounce previously in a different battle. Moves you Sketch are there for good, even when you leave the battle.
The question asking "What is a good moveset for Smeargle?" is there because Smeargle can learn any move in the game (except Chatter) using Sketch. It does not need TMs since it can learn every TM move with Sketch anyway. And remember, TMs aren't the only way Pokemon get moves. They can use Egg Moves, tutors, events and more.
If you are still confused, read up a bit on Sketch. You don't seem to have a very good idea of how the move works.