It is believed that dogs kick their legs after defecating to mark their territory. In addition, a dog has scent glands located in its paws. By kicking its paws out and upturning dirt, a dog can release more scent into the area and better mark it.
Pheromones are chemical messengers that trigger a response in animals of the same species. A dog releases its pheromones in its urine and feces. Pheromones are not fully understood in canids, but it is theorized that a dog can communicate to another dog about its dominance or submissiveness. A dog's owner may notice a pattern in a dog's behavior when marking territory. If the behavior is damaging the yard, positive reinforcement such as providing treats or throwing toys can train the dog to cease the destructive behavior.