It's quite natural for a dog or cat not to soil its own yard, but to find some other area. They often head for your neighbor's yard, garden, or child's sandbox.
Even the friendliest neighbors may become angry when your dog or cat wanders onto their lawn, soils their yard, and digs up grass and flowers.