well, it does depend on the type of dog, jack russells for eg are renound for this kind of behavoiur, my advice to you is if he gets out of the house and it is not on a main road call him if he doesnt come back close the door, and wait, open again after a few mins if he has come nearer, crouch down call him again with a treat in your hand, if he still doesnt come close the door again but for a tad longer until eventually he comes then reward him, and try not to loose your rag. if it is unsafe then obv you can not do this so id go out with a tasty treat or ball and temp them back chucking a treat a bit closer to him then back away etc etc , on walks if he just disappears and goes off i would not let him off lead at all, but in garden call him offer treat reward him praise him, over and over again until you have got the recall, then always take treats on a walk, if all else fails, buy a collar with a zapper, after all a dog needs to run and the ext lead is not a run, treats and perservirance, if you practise daily in your garden i reckon after a week or two it will work.