I think your cat has worms
It all depends on how old your cat is? Could be anal sacks, for that you need to take your cat to a vet.
The dog may have worms and is trying to alleviate itself.
One of my 3 indoor cats who is 1 year drags his butt across the carpet after pooping. They all eat the same thing and use the same box that is cleaned twice a day. Help