One of the basic ideas of dog training, or horse training, or training whatever, is to train where you can, and don't train where you can't. Duh, this seems obvious, but you might be surprised at how much dog training is attempted in totally the wrong environment.
Where would the right place to train your dog be? Train in a place where you have control over the his emotional state. If your student is so excited, so nervous, so frightened, that he can only pay attention to what's going on all around him instead of paying attention to you, that is the wrong place to train. Horsemen understand this idea because if a horse too excited, too nervous, or too frightened to pay attention to his rider the it's very likely that the horse will use the horse's first defense to anything they don't understand, which is to run away. Attempts by the rider to prevent him from running away can result in bucking, falling down, rearing, or jumping abruptly to one side (which in the horse world is known as “teleporting” ), any of which can cause the rider to be dumped on the ground. In other words, a rider pays attention to where she is training, because if she loses control of her horse's emotional state, there is a good chance she will get hurt.
Unlike a rider, a dog trainer is unlikely to be injured if he is training in a location where the dog is too distracted or fearful to pay attention. However, dog trainers face exactly the same sort of reactions from their doggie pupils. A dog that is too excited, too nervous, or too frightened to pay attention to anything other than whatever is going on in his environment will jump up, run around, spin around and around, try to run away, or throw himself against the end of the leash. He might try to bite other dogs, or anyone who tries to control him. On the other hand, he might do the doggie submissive thing and roll over on his back hoping that whatever it is will decide not to kill him. Obviously a dog who is doing any of those things is not in a good emotional frame of mind to learn anything.
If your dog is unable to pay attention, trying to teach him something just isn't going to work. Unfortunately, since we humans are larger than dogs, some folks have the idea that there is no dog they can't yank around, and how are you supposed to train a dog to stop jumping, hiding, throwing himself against the leash, if he isn't doing it? So if their dog is overwhelmed by his environment, and is behaving in an unacceptable way, they figure it is just another training opportunity, and they resort to yanking and punishing in an attempt to get their dog to deal with what to him is an overwhelming situation instead of just moving him to a place where he can be calmer, and working on the lesson there.
So what about that catch 22, "how are you supposed to train a dog to stop his jumping, hiding, pulling, etc. if he isn't doing it?" Actually it's not a catch 22 at all. First realize you can't teach a dog to "not do". You can really only teach a dog "to do". You can teach him how to handle frightening or exciting situations by starting teaching him what you want him to do in a non stressful environment, and slowly introducing him to more stressful environments.
Need some examples? Our shelter dog Raymond, used to run out the door at every possible opportunity. He was a master at getting out the door. Our house wasn't his "first rodeo" and he knew a lot of tricks. Once out the door he would then take off down our driveway, run along a heavily traveled street, and end up about a mile and a half away in a different neighborhood. We figured out from that and some of his other behaviors that he was seriously stressed from having been at the shelter, and then moved to yet another strange environment. His solution was to hide under our stairs, or to run away. However, understanding this didn't fix the problem, and it was a real pain to have to go get him even though after running a mile and a half, he was quite happy to come to us.
The solution was to practice good door manners in an environment that wasn't so exciting to him. For several weeks Raymond and I played the “follow me everywhere” game. I kept Raymond on a leash and lots of treats in my pockets, and whenever I went during the day--to my home office, outside to water plants, to the barn to feed my horses, to my closet to change clothes, to the laundry to load the washer--Raymond went with me. I made sure I kept all the doors in the house closed so that we had lots of opportunities to practice opening them and then following me through them calmly. Now a door inside the house isn't nearly as exciting to a dog as the door to outside, so while Raymond's door manners were lousy, at least he wasn't completely nutso. I didn't really do “training”, I just insisted on going through the door first. I always used the word “wait”. I didn't insist that he sit (he was way too excited for that), I just made sure I went through the door first. At first this meant that I sort of shoved in front of him, but I wasn't concerned with being elegant. I didn't say “no”, I didn’t punish him, I just acted like a person on a New York subway. In other words, I was very pushy. After a couple of days, I noticed that Raymond would hang back just a little when I said “wait” at a door. Going outside was more of a problem, but after a week, he was better about that too. After 3 weeks, when we would get to a door, even if he had been walking in front of me and got there first, and even if the door were already open, he would wait for me to go first. After a month, I could go out the door to our garage (where he used to do his escape routine) and he would wait patiently for me to leave, or if he was going out with me, he would sit patiently for me to go through the door and then invite him out.