Here are a few tips for dealing with the problem of a dog who escapes, whether it’s from a yard or directly from a house. Fireworks bring out the desire to escape in many dogs, but of course this is also a year-round concern.
 Create a routine for when you leave the house. If you have children who dash in and out, this applies to them, perhaps even more than to you! Besides the obvious things of collecting your keys and purse or other things and locking anything that needs it, you might also want to glance at the dog’s water dish and be sure that the dog is where you want him. If the dog will be going with you, be sure his leash is on securely. Teach him to sit before you go outside, even if there is no apparent need to — it makes everything calmer and it’s easier for you to remember everything.
 If your dog tends to escape from your yard or garden, often there are things that you can do to make this less likely, such as fixing a spot where the dog can get out. Maybe it needs to rise higher on your list of things to do, or to have someone else do.
 Exercising your dog before you go to work will make him more relaxed while you are gone, and thus less likely go looking for excitement. Leave him some toys if he likes them — I’ve found a Kong stuffed with food to be popular with my dogs. (Link goes to my article here on using the Kong as a training tool.)
 Males who have not been altered may be more likely to roam. You know what they are looking for.
Considering the consequences of a dog loose in the streets, it’s well worth your trouble to keep your dog where you want him!
On a personal note, I remember more escapes of dogs of mine than I care to admit to!
Our house in Colorado had a mudroom between the living room and the out of doors, and this did help with coming and going. But once our Basenji darted out that front door when a couple of friends who were housesitting were not quite as used to her quicksilver movements as we were. They grabbed some food treats and her leash, and went after her. She led them on quite a trip in that semi-rural area, never letting them out of her sight, never letting them get within a few feet of her. She had absolutely no interest in food treats… freedom was much more fun! After about 45 minutes, she darted into a culvert under the road and the people were able to block off both ends. Sunbeam let them put the leash on her nicely once the jig was up.