Teaching my dogs to stay back behind the door threshold is always an important safety thing to me. I do live on a pretty quiet road but still...cars go by. Threshold training isn't fool proof, doesn't replace using a leash or having a fence, which I have but only the back yard fence is solid. These little toy poodles can get through the pickets on my front yard fence. So, we've worked on threshold training since they were puppies. And they're pretty darn good at it. I haven't added big distractions and wouldn't trust them to stay back if a cat or squirrel ran across the road. But for the most part, it definitely helps. I have practiced going out of sight, not only for this, but for the sit or down/stay. I like to teach default behaviors whenever appropriate...in other words, I do not want to have to tell them things all the time so don't use verbal cues in every application. This is one of those situations where I have not told them to stay or wait. I have only prevented them (leash) from getting the reward of going outside until they figure it out that they should stay back UNTIL I give them their release word. So that's how they learned this.
Anyhow, to the point. I wanted to share a cute story...well, it was cute to me. I was visiting my Mom with my two toy poodle boys, Matisse and Maurice. My car was in the driveway around the corner, out of sight of the front door. We were going somewhere in the car so I was putting Maurice in his crate that was already in the car and was going to return to get Matisse in a minute. I closed the door behind me, but apparently, it didn't latch tightly and the breeze caused the door to open widely. When I was returning up the path to the front door, there was little Matisse, sitting so dutifully on the rug in the entry way, looking out the front door but not about to cross that threshold without me. What a good boy. He got a good treat and lots of affection.
Just the other day I heard of a dog that ran out the door when someone opened it and he got hit by a car and killed. It was so disturbing to the people who saw this, as I can imagine. I see my neighbor's dog slipping out an opened door ALL THE TIME and he runs. It is so dangerous. So, this is something that is good for them to learn, along with a good stay and recall. Again, it's not fool proof. No dog is 100% trustworthy no matter how well trained. But it's helpful in addition to physically preventing them from running out the door.