Much like reflexology and the human feet, there is a complete map of the canine body on their ears.
Apparently it's not at all uncommon for a dog to slip happily into a state of bliss when his ears are being rubbed.
A rubbing, stroking motion stimulates the pituitary and hypothalamus glands which releases endorphins.