Working on door manners significantly mitigates the likelihood of door dashing (running out of the front door into the neighborhood). Practicing this at all doorways, gates, and thresholds is best.
Have your dog on a short leash and walk toward a closed door. Begin by having your dog practice Sit/Stay while at doorways. Open the door steadily as they maintain Sit/Stay. If they break free from Sit/Stay, stop opening the door until they can produce and maintain Sit/Stay again. Continue practicing door manners with Sit/Stay until this behavior is automatic with your dog.
When exiting or entering a doorway or gate, you will be first and then give release for your dog to follow you.