I think you're going to get mixed reactions no matter what because it really does vary with every dog.
I know several people who use an invisible fence/underground pet containment system that love them and between them all, they have every size and temperment of dogs you can imagine.
So I tried it last spring/summer, but had disasterous results. I paid $2,100 for a state-of-the-art guaranteed or your money back system. I worked with their trainers for 7 months with my dog running right through no matter how much boundary training/reward training/verbal beep warnings/8 foot wide shock system/three different collar designs before they finally admitted it wasn't working. And then they tell me the money back excludes training fees and only gave me back $1400 of my $2100! That was NOT on the contract anywhere by the way. My fault for not questioning their policies better. And this was from the biggest and most reputable company in my state.
As far as your dog leaving, yes, you can set shock levels on the collar, on the digital line running underground, as well as the range of the line, from 2 ft to 8 ft. I always tested the shock level on msyelf first (inside palm) to make sure it wasn't too painful and even the high settings are definitely noticeable, but not painful. It's more about using it to teach boundary training. And my dog has passed several training courses, so he knew perfectuly well what we wanted from him. He just didn't care. The lure of running free was more exciting to him. I wasted hundreds of dollars, hours of time, and more embarrassing moments witnessed by the neighbors chasing after him than I care to admit. (Keep in mind, every time they run through, you have to catch them!)
The idea with the collar is that you remove it for walks and you don't take them for walks over the boundary for the first month. You get in your car, drive out of the driveway and out of boundary range, then go for the walk. If they run off, you chase after and catch them, remove the collar, bring them back into the yard, and put the coillar back on. And if you don't watch the trainers VERY closely, they will then try to drag the dog back and forth over the boundary line after an escape so they get shocked over and over again as a "lesson."
Again, it's not painful perse, but neither is it pleasant. And when I refused to let them do this, they said I wasn't being cooperative with their training.
So it really does depend on every dog and probably every company as well. Because I know so many people that love it, I still believe they're worth a try. But I would ask details about their refund policies before signing anything so you don't get hosed like I did. I would also ask detailed questions about their training methods and schedule them so you are present for every single one. I would not recommend them if you have a runner like me.
Hope that helps!