The primary safety issue with invisible / electronic / underground fences is that they do not protect your pet from people and animals coming to your dog and possibly harming it. A standard fence, for example, keeps unfriendly dogs out as much as it keeps your dog in.
As for the collars, I bought a Tri-Tronics vibration only collar for one of my deaf dogs (and then trained the vibration to be a positive experience.) The manual was the same as the one for shock collars and it recommended that for the dog's health and safety that you make sure the dog has an extra pad of fur underneath where the electric part hits. I read that as the manufacturer saying they aren't necessarily safe as is.
There are also a number of risks to using punishment based training at all, these are well covered in the "American Society of Veterinary Behavior Punishment Position Statement"
Keep in mind that if you get such a fence, you also need to train your dog to the boundary, so that the collar only goes off when they break the 'rules' they have already learned. It is possible to teach this behavior without purchasing the fence in the first place. Additionally, the fence itself can negatively reinforce behaviors other than leaving the yard - Trainer Experiences with Invisible Fencese