I am assuming you mean an "invisible fence". It works for many dogs if they are properly trained to it, but isn't a good idea as a stand alone, because as mentioned some dogs will run through it with the right stimulation. The other problem is that even if it keeps your dog in, it doesn't keep others out. Your dog is vulnerable to attacks by other free running dogs.
Now, if you live in the country, you could put up a "real" electric fence, and a properly constructed "predator" fence will keep most anything in (or out!)
Invisible fence is very useful to keep climbers off a physical fence or diggers away from it, or to keep them out of gardens or other places you don't want them to go.