I think it stems back to the days of the wolf when they would roll in a rotten carcass or shite to disguise their own scent to get closer to their prey. I had a terrier what loved to get down onto his shoulders and into fox shite ,it was like black tar and the smell was unreal ,so it was a walk back through the allotments and put him under a stand pipe and wipe him with a big docking leaf, he always seemed to enjoy the rolling in it . Our little domesticated wolves