Usually you would have the entire circuit grounded to a metal stake pounded into the earth. The high voltage output is normally a high voltage with respect to the ground of the circuit, so the HV output on a wire fence should work to keep animals (who are touching the ground) away from it. As Ron mentioned, though, it really depends on the type of fence. If you just have some posts in the ground and wire strung between them (with standoffs), you should be fine. If you have a chain link fence, however, that is built into the ground, it will not work. It will simply create a dead short.