Well I found out one thing. If you own a horse, they can just come and go through gates on your property like people. Alex went and bought a horse and fenced in a huge paddock with a food and water trough. There was also a fence around the vegetable garden. While she was napping, Pepper started just wandering around the block in and out of the paddock then I just noticed Pepper's icon for what she was going to do next and it was eat carrots. I followed her and the paddock gate just opened for her then the garden gate just opened as well, that's when I cancelled her action!
mm, OK, just went and locked the gate of the paddock to pets, that might keep her in.
I presume that if that works, it will also keep pets (including those not belonging to me) out of my garden.