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.
I am just glad I don’t live in bear country. I have been on 5 or 6 bear hunts with my husband, both in the US and Canada, so I have seen plenty of bears in the wild.
Of course we were prepared for it but I would not like for them to be wandering around my neighborhood.