How do the police and military train their puppies to stop and come immediately

They start with dogs bred to be highly intelligent and responsive to a handler.

Then those dogs are raised to be highly socialized and to be able to focus on their handler/chosen reward.

THEN they are trained using balanced methods so that the puppy believes that it cannot disobey successfully (i.e. the reward they were disobeying to get is removed when they try, or the puppy is physically blocked/stopped, or the dog gets a correction) and that obedience is highly rewarded with the stuff they love best.

A dog doesn’t get to do the “bite” game (which they have been bred socialized conditioned and trained to think of as the greatest reward ever) unless they obey.

Related story  Being a puppy owner what is the best thing that you have felt experienced so far