Slipping into a shallow hole can help keep a dog's legs warmer in the winter, and summer holes are commonly dug in mud or damp leaf litter to help the animal cool down. When your pup goes to town scratching on your bed, he's instinctively preparing a comfortable place to lay, much like you might plump your pillows or straighten blankets before you lay down.