I used to have a Beagle mix that was always getting loose. I tried a pen made of old panel pieces when he was a pup -- chewed a hole in it. Tried an electric fence wire about 11" above the ground and another a little over that and so on 'til he couldn't jump it. He would sneak up on it 'til his nose told him when it was on and off, then rock with the pulse of it. All of a sudden he'd bolt, usually just catching the tip of his tail as he got through it and let out a loud "yipe!". The worst part was having him and the Gordon Setter on tie chains. More often than you would believe, I'd find the Gordon with two chains hooked together and the Beagle gone. I watched him once. He would drag his chain back and forth, back and forth until the latch caught the other chain just right, and away he went. (We couldn't justify investing in any decent amount of woven fence, so kept trying other things.)
I always knew where to find him, though. There were some squatters living in a camper about a mile down the road and back a 1/2 mile lane who had a big Shepard mix female. The Beagle was a very sociable guy, and would always go to visit his girlfriend. I would ride down there on the dirt bike, find him, load him on the tank with his front feet on the handlebar, and ride back home -- slow. He would always get punished for his transgressions, but it never cured him. I don't know which he liked better, his girlfriend or the motorcycle ride!