There are few reasons for rear end irritation and licking. The most common is due to fullness of the anal glands located in the wall of the rectum. These are grape sized, shaped like pouches and hold some of the smelliest material on the planet! They have been theorized to be old scent marking glands. When they become full it can be quite uncomfortable for your pet and would require manual removal of the material. This needs to be done by an experienced person because if done wrong it can cause a lot of pain and possibly rupture the gland itself.
Some dogs may have small and empty glands but are still quite irritated because the glands themselves are inflamed which is called anal gland sacculitis. This condition is secondary to an underlying allergy such as food allergy or environmental allergy say to grass or pollens. Intestinal parasites such as tapeworms can cause an itchy butt as well as flea infestation.
Here is an interesting bit of information. It is said that Cavalier King Charles Spaniels will scoot their rear ends as a behavioral issue. They are known to do this when company comes over and they are showing off. Wow.