We take for granted how effective our hands are. If your back itches, pretty much anywhere on your back, you can itch it. Canines do not have the flexible joints and long extensions that we do. They can compensate with a contortion of the spine, but even still there is a huge swath along their lower back that they could not itch if they tried. That kind of relating itch you can not reach is a torture I would not wish on my worst enemy. Could that be why your dog loves nothing better than a good scratch? Well, no. Probably not.
The Root of the Behavior
Although there is some truth to all that, it is far from the bigger reason dogs seem to like being scratched. Most canines cannot reach the base of their tail, and so cannot scratch it themselves. In this particular case, if that is where your dog likes to be scratched, then it may simply because they needed someone, anyone, to do it. Dogs scratch themselves to dislodge bugs and dirt and a host of other thing from their fur, which often picks up everything like a Swiffer.
If your dog, however, likes being scratched where he could clearly reach and itch themselves, then this is more likely than not a learned behavior. For thousands of years, canines have been bred by humans to be companions. The dogs who exhibited the behaviors we enjoyed most got bred more until eventually we systematically chose the characteristics we wanted them to have.
In this case, the dogs that were more agreeable to human affection. This is likely why most dogs like being scratched. Even today though, there are dogs that do not like to be scratched, and some feel very strongly about it.
Any time you may be dealing with a dog you are not very familiar with, it is important to pay attention to their body language. If they move away or make a throaty noise, you should stop. This is their way of communicating to you that they do not enjoy what you are doing. Dogs with aggressive tendencies or some trauma in their past may go as far as lashing out at you for ignoring these signs.
When petting and scratching a dog your unfamiliar with, avoid the head and legs. Contrary to popular belief, a lot of dogs don't actually enjoy this, instead simply permit it begrudgingly. Others may get defensive or vocal. They will tell you through their body language how they feel about how you are interacting with them at almost all times.
Encouraging the Behavior
The far likeliest reason your dog loves to be scratched is simply because you have trained him to like it. If not you, then a previous owner or caretaker. It happens so quickly and innocently that you would never know unless you knew what you were trying to see.
The process goes like this. You get a dog and bring them home. In your excitement, and with the preconceived notions that petting a dog makes them happy, you pet, rub, scratch, hug or whatever else you do to show them affection. Then you proceed to build a life with them. You feed them and house them and play with them.
It is already done, did you catch it? You see, even if this is a young pup that until now knows nothing, up until this point he learned that you pet him and you clearly want him there. He learns that you are communicating to him your affections. The more often you pet him, especially whenever it is in response to him behaving well or performing a command, they learn that this is your way of telling them you like them. So in the end, your dog may truly like getting scratched because they just like hearing that from you.
Other Solutions and Considerations
A dog seeking scratches far more often than that same dog does typically may be a sign of an underlying medical concern. Pests in their fur, infections, and rashes causing irritation could be causing them to seek out relief, regardless of how fleeting. Your scratching provides them just that, but if your dog is exhibiting that kind of behavior then it may be a good idea to seek out the assistance of a veterinarian to make sure they are happy and healthy. If they are perfectly healthy and the excessive behavior continues, a behavioral specialist should be able to help you further identify what could be cause them to act in that manor.
It sort of illuminates why dogs who are not familiar with you may not like receiving this kind of attention from you. We inadvertently train our dogs constantly just by interacting with them every day. It seems a bit silly we taught them that we show affection through an act they may not enjoy and wouldn't otherwise like. Taking one for the team, that's another point on the board for man’s best friend.