You are not barking mad, many a TV sitcom has been made about this particular living arrangement, because when 'slobby' doggy moves in with top cats a classic situation for comedy and contrition is created.
There are two possible endings to this particular episode. Either you adopt the 'Love Me Love My Dog' option and accept your friend's partner for who and what he is, taking them both to task by setting some simple boundaries for this messy pooch and his keeper. For example:
"Sarah when you let Rover, eat pizza in front of the TV and he leaves smelly boxes, beer cans and ashtrays on the floor, like the time you were away and he invited his friends to watch the match and you told me it was just boys being boys."
"I felt disrespected, angry, frustrated, betrayed, hurt, lonely and a little bit jealous."
"And although I cannot force the two of you to change, if you continue to behave in this way I will protect myself in future by asking the cleaner to do extra hours at your expense".
Or reading between the lines, I would venture that the real reason this 'menage a trois' is not working for you is that you fancy the pants off this dirty dog and that the mess issue is not the only bone you would like to pick with him. This however is a more difficult problem to solve as this time the boundaries you have to set are with your self.
Be honest about how lonely you are and how jealous you feel that your friend has someone who wags his tail for her. As hard as it is, try to separate real housekeeping frustrations from your personal and totally understandable frustrations as a woman and 'jilted' friend.
Sadly I am afraid that for harmony to be restored in the home either Rover has to stray or you need to find a 'best friend' of your own. A very last resort would be to move out and rent your 'half' back to them or sell the joint house and go your separate ways.
But beware, with both of you so well versed in the law this has the potential to become the mother of all cat fights. Should it come to this, employ independent and impartial council and remember as in all divorces, he who gets out quickest moves on quicker. Do not waste time licking your wounds.
Laura's recipe for The Dog's Bolognese (a tasty dish for when you don't want to mince your words)
500g minced beef
1 medium onion peeled and chopped into eight
1 garlic clove peeled, squashed and halved
1 glass of red or white wine
25g Taste # 5 Umami Paste (a good squirt or dollop to taste)
25g tomato puree
1 large bay leaf
5 tbsp of extra virgin olive oil
salt & ground black pepper