Vet at FirstVet answers:
There is an area on the upper side of the tail that contains a large amount of sebaceous glands. Some dogs have a sparse hair coat in this region and some owners believe the gland is hormonally affected during different periods. Sometimes an inflammation in the sebaceous glands causes the affected area to become swollen, tender and ulcerated. Put a buster collar on your dog if you find it licking its tail. Keep the affected area clean by washing it with a chlorhexidine based cleansing solution.
If it does not improve within a couple of days contact a veterinarian. Certain infestations and hormonal disease can result in similar symptoms.