First of all, it's important to understand that not all gay men are into anal sex. There's a lot of different options and it's not all about the butt-fucking.
The second thing to know is that top/bottom doesn't just describe the person who puts their dick in the other person vs the person on the receiving end. There's another component that has more to do with submission- just like some guys are turned on by women who are aggressive in bed, there's also guys who like role-play with other guys.
Specific to anal sex, the same way that straight couples handle anal sex or how straight couples handle a preference about oral sex. If it's casual dating, maybe you decide that you're not compatible and you move on to someone else. If there's a more serious, lasting relationship, then you either negotiate or you find other things that you both like to do.
It's probably more of a "thing" in the world of NSA sex and social apps. If you're horny and want to get off, then you're shopping around for what you want... just like when you're hungry for pizza, you don't look through websites for Thai restaurants.
In the dating situation, you might be more flexible on the topic. If you're both guys who like being the dominant partner or you are both strictly anal sex top-only, then you may make arrangements for an open relationship or three-ways. If you're versatile with a preference, then you negotiate on who gets to do what and when.