I wouldn't consider electric fencing especially safe. It does cause pain, which can make your dog neurotic or aggressive. For example, the dog sees someone walk by, the dog gets close to the fence line, and feels pain. The dog begins to associate seeing people with pain.
In addition, it does not guarantee your dog won't run through the fence if he or she sees something extremely interesting. It also allows people and other animals to get at your dog, so your dog is still at risk for being stolen or attacked.