There are alot of variables. Some games you can get away with it as long as you don’t make a big song and dance (no colours / minimal celebrations).
It does depend on the type of game you’re going to, it also depends how those around you react to events in the game, not just how you do.
Less so recently, but i’ve seen reds sat in the home end at Goodison with their mates and vice versa. It’s one of them, you’ll get stick whatever the result but you can’t really give any back as you’re in their back yard. You just have to smile politely and keep your head down.
I worked at United for years where at least 75% of the matchday stewards are either City or Liverpool fans. It makes for interesting reactions when the game isn’t going the way of the home team, put it that way.