Dogs scratch with their hind legs when they’re rubbed on their side because they’re being tickled.
Your arms flail around and you might even jerk away if you are poked or tickled in the ribs, or your leg kicks out when the doctor knocks your knee.
The reflex from a dog isn’t much different.
A dog’s central nervous system translates your touch as an irritant, such as a flea or tick.
The dog is instinctually responding by scratching at it.
Knowing this, we can’t imagine this game would be much fun for the dog, despite the hours of entertainment it may provide its owner.
Stupid Dog Tricks.