If you catch your dog rubbing along on the carpet, worm him with a good quality wormer such as Drontal or Milbemax that covers all worms, especially tapeworm.
If he is still irritated or if he seems off colour then bring him in to the surgery. Many small dogs suffer from anal sac problems. The gland fills up with material too thick to empty through the small ducts in the anus. Usually we just express them and all is well.
Sometimes the material gets infected and the glands become swollen and painful. Your dog might have trouble defecating or lick the area a lot. The glands may break through the skin and discharge foul smelling fluid. At the surgery we clip and clean them as well as starting antibiotics and pain relief. If your dog has repeated anal gland infections we recommend surgery to remove them.
In spring and summer many allergic dogs rub, lick and scratch all over including their bottoms. Some dogs allergic to food proteins also rub their bottoms on the ground. Treatment for the allergies usually stops the rubbing and licking.