Various things might cause a horse to rub its tail including worms or food allergies. I suspected food allergies with one gelding who rubbed his butt so much that he not only rubbed the hair off but, also, rubbed holes in his skin. The skin around his anus was also rough and dry. I started applying MTG.
The first time I tried rubbing MTG beneath the horse's tail, he swatted me with his tail. Once he found it provided relief, things were different. When I walked up to him carrying the bottle of MTG and asked if he was ready for his medicine, he would turn his butt towards me. When I stood on his right, he would move his tail to the left. When I stood on his left, he would move his tail to the right. Not only did his skin grow back, but the hair grew back so there is no evidence that he ever had a problem.