This happens in my house ten times a day. It's complicated.
My dogs won't pass the big fat mean cat in the hallway. They prefer to go around.
They used to have a cat who was their good buddy, then when he died, I took in a "rescue" who beat the shit out of them and left their noses bloody. They've never fully trusted cats since.
Even when my Mom's "mean" cat got old and feeble, my dogs wouldn't voluntarily go into his territory.
But my big fat mean cat won't pass my rescue dog in the hallway. He yowls until someone comes to resolve the situation.
(Rescue dog likes to lay in front of the pet door, for access control.)
But his shy sister loves the rescue dog and rubs up against him every chance she gets. He licks her on the head and looks embarrassed.