Thank you for the reply.
At first I was thinking that he may have developed colitis (inflammation of the colon) from eating the cupcakes and the irritation of the paper wrappers passing, but if the stools are formed, that is less likely. The signs however can be very intermittent and can vary in severity, from normal stools to mushy to very soft, all even within one day at times. Seeing mucus or blood is not unusual in some cases. There can be a sense of urgency to move their bowels and many of the pets will strain when having a BM, which to the owner can almost look like they are constipated. Many pets with colitis have GI discomfort and some will even vomit, but most act like they feel pretty well. It is possible that his colon is still irritated and he is passing mucus. When this happens, they can develop peri-rectal skin irritation form the leaking mucus and the licking.
Another scenario is that the cupcake ingestion was incidental and this is unrelated. When there are sores and redness of the anal area, we have to be worried about an anal gland infection or impaction. These are very uncomfortable and the dogs will often lick to the point of bleeding or rupture.
The best course of action would be to have his anal glands checked by your veterinarian and to have a rectal exam performed to see if there is mucus in the colon. In the meantime, you could try epsom salt soaks of the rectal area to relieve inflammation. I would suggest using an cone type collar as well to keep him from licking.
Additionally in case it is due to GI irritation, I would fast him to give his GI system a rest. Since he is an adult dog, a 12-24 hr fast will not hurt him and will let his gut calm down. Continue to offer small amounts of water at a time. When you do begin feeding him again, you will want to offer frequent, small meals of something very digestible for him. These would include items like boiled hamburger or chicken and rice or pasta. No sauces or gravies, but a little non greasy broth would be OK. If things improve, I would continue that for a few days and then slowly wean him back onto his normal food and feeding schedule.
I hope this is helpful. Please let me know if you have ANY other questions. My goal is to give you 100% satisfaction and if you are not yet satisfied, please reply so I can clarify for you.
My posted replies are for general education only and not meant as a diagnosis. Only after a thorough veterinary examination can a diagnosis for your pet be made and specific treatments be advised or medications be prescribed.