The behavior in wolves is known as “scrape behavior”; it is also present in their domesticated relatives. The activity is commonly seen to be a visual marking, the scrapes, as well as a means of spreading scent to mark territory (as noted, dogs have scent glands in their paws).
This activity happens most often in new areas, in the presence of other dogs, and in the early mornings.
All dogs will have different types of behavior depending on their breed, environment, whether they are in a public place, contained in a limited area and their upbringing. As shown by animals from overcrowded and inhumane puppy mills.
So observed behavior can be an aberration of natural behavior and sometimes an adaptation of being kept in captivity. It is natural and right to derive animal behavior from it’s natural state in the wild, but behavior within the context of captivity cannot always be definitively explained. As with the pawing on the ground with elimination and defecation.
Dogs will also scrape or wipe their paws, or make digging actions after elimination or defecation for hygiene reasons.
One reason dogs scrape their paws after urinating or defecating is to clean their paws and another is to cover their waste. Similar to cats covering their mess, but not as thorough. You’ll also find they scrape away from the direction of any food or water source or place that they sleep.
If you observe a dog that does not cock his or her leg to urinate, the urine pools and usually the dog will extend their back legs in a display as they are wiping their paws clean.
There are observable differences between how dogs scrape and dig after going to the toilet, depending on the ground surface, and how they have relieved themselves.
Sometimes there will be more digging with front paws included in an attempt to cover up the feces, other times the paws will be scraped backwards from behind the mess in an attempt to wipe urine from them.
When there is plenty of mulch, dirt or leaves on the ground, a dog will make a better attempt of covering up fecal matter. Then there will be the more theatrical scraping, which is consistent with marking.
It is possible to train your dog out of this behavior if you so desire. In short, it involves distracting him immediately after his activity with something like a treat in order to get him out of the habit.