My poodle was like this when she was younger. When she was by anyone who opened the door, she would bolt out and run around the neighborhood. There was one time when we chased her for a block.
Now that she's a bit older, she stays on command when we open the door. But there are times when she still bolts out, and that's when she needs to potty. Sometimes we still need to chase her when this happens. Inside the house, she listens so well, but when she's outside, it seems all of the things we taught her disappears