One of the main reasons why dogs roll around during walks is to mark their scent on their surroundings. Dogs have sebaceous glands in their skin that release pheromones. By rolling on different surfaces, they leave their scent and thus reinforce their presence in this space.
Dogs are descendants of wolves and still share some instincts with their ancestors. Rolling can be a way for dogs to mask their own scent by covering themselves with the scent of their environment. This behavior could be a legacy of their wild ancestors who used this tactic to hunt and avoid being spotted by their prey.
Dogs use bearing as a way to communicate with their peers. By rolling on a particular surface, they can bring this smell back to their group, thus letting other dogs know what they discovered during their walk.
Dogs have a much more developed sense of smell than humans and can enjoy exploring different scents. Rolling can simply be a way for your dog to enjoy the sensations and smells he encounters during walks.
Observe your dog closely during walks and try to spot the warning signs of rolling, such as heavy sniffing or approaching a particular area. Distract your dog's attention before he starts rolling around using verbal commands, toys, or treats.
Train your dog to obey commands like “no” or “leash” to keep him from rolling around in unwanted situations. Positive reinforcement, such as kudos and rewards, can help encourage appropriate behaviors.
If your dog rolls over a smelly or dirty surface, be sure to clean it thoroughly after the walk. You can use specific wet wipes for dogs or, if necessary, give them a bath to eliminate the smell.