Just exactally what you said it is. Mucus. It is the dogs bosy way of cleansing it self. It he has more then normal for a longer period of time then talk with your vet. That could be some kind of infection. But I wouldn t worry to much. Our bodies do the same thing.
That is a problem with anal glands
I just had to take my dog to the vet for the exact same thing. We have stray cats outside and so the yard is infested with fleas even tho we have an exterminator spray the cats still have the fleas so they come back. When the dog goes outside no matter how many times we bathe him the fleas get on him. When the animals bite the fleas the swallow them and because of that he contracted tape worms from the fleas. He had to have a shot.