If you notice your dog is digging tracks or around tree and shrub roots, they may be after a critter or insect. Never use pesticides or rat bait in areas your dog can access. Consider more humane methods of catching or deterring pests in your yard, because although uncommon, dogs can get secondary poisoning from eating mice or rats killed with poison.
If your dog likes digging, make the areas you want them kept out from inaccessible and unappealing by placing rocks or fencing around them. Create your dog their own digging zone to let them satisfy the urge and make sure dog gets adequate exercise and attention throughout the day. If you must leave your dog alone for long periods of times, make sure they have enough toys and access to shelter.