Obviously, gay men can have anal sex together with a penis, but straight and gay guys alike can engage in anal play or sex with fingers, oral sex or sex toys. It should also be noted that often, orgasm via only prostate stimulation will happen without an ejaculation. Some people with pensises can reach orgasm through stimulation of the prostate only, and most people who engage the prostate through anal sex or prostate massage report that orgasms which involve prostate stimulation - alone, or when combined with other sexual activities - feel far more intense or stronger, and go on for longer, than orgasm reached through stimulation of the penis alone. It's a very sensitive gland, and even when you don't directly stimulate it, your prostate is part of your sexual response and your orgasms. Some folks call the prostate gland the "P-spot," or the "male G-spot", to make a comparison between it and the "female" G-spot, an area of the vagina which is often very sensory and pleasurable in a similar way.
Stimulation of the anus and/or perineum - that flat length of tissue on the outside of your body, between your anus and testicles - directly stimulates the prostate. Its primary function is to store an alkaline fluid that is part of your semen, and it also has some small muscles that help to expel ejaculate. You can look at our cross-section of the sexual anatomy of a person with a penis to see exactly where it is.
The prostate is a very sensory, walnut-sized gland that is inside the body, below your bladder between your rectum and the urethra at the base of your penis. With people with penises particularly, a big reason anal stimulation or sex can be so enjoyable is because of your prostate gland (people with vaginas don't have one). Our anuses and rectums are also part of our genitals as a whole, so stimulation of the anus can increase stimulation of or sensation in our other parts.
Most of us tend to enjoy sex the most when it focuses on the places where our bodies are most sensitive, and thus, plenty of people enjoy anal sex of various kinds.
The anus is pretty darn sensitive for people of all genders, full of sensory nerve endings. People of all orientations may or may not enjoy sexual anal stimulation. A guy can be straight and enjoy anal sex great big bunches: if you only desire anal play with men, then we're dealing with an orientation issue, but if you desire and enjoy anal play full-stop, it's just not about sexual orientation. You can also be gay without engaging in anal sex: being gay is about being attracted to the same-sex, not about having a certain kind of sex, so even a gay guy who never has sex with anyone is still gay, just like a hetero person who has never had sex can still know they're heterosexual and be heterosexual. So, a guy can be gay and yet not be all that interested in or even enjoy anal play. Enjoyment of anal sex does not define or determine homosexuality, and lack of enjoyment of anal sex does not define or determine heterosexuality. Know what? Some gay men do NOT like having any sort of anal sex.