It isn’t the shock itself that I’m concerned about. You have train the dog to respond properly by backing away from the fence line. If the dog is trained to do that and ends on the other side of the fence, it will stick to it’s training and not be able to enter the yard.
If a dog gets out, they bring the others in, turn off the system, get the dog back, turn the system back on.