Electric fences are allowed but generally only to keep livestock in or to protect livestock(chicken coupes, rabbit hutches, etc.). Surrounding your whole property with a fence would require some tricky legal navigating. There are a ton of state rules about electric fencing.