This article on Refinery29 goes into detail about how and why anal sex doesn’t result in pregnancy.
Anal sex is a kind of sex, but just like oral sex, it won’t result in pregnancy — no matter what genitals the people involved are working with. While you can transmit STIs during anal sex (and during oral sex, too), pregnancy won’t happen — except in one rare situation. […] Pregnancy doesn’t happen during anal sex because the anus isn’t connected to the vagina or any other reproductive organs. People without vaginas can’t get pregnant — while “m-preg” is a popular fanfiction category, it doesn’t work that way in real life: trans men can get pregnant, but cis men cannot.
It then proceeds to detail the one scenario where pregnancy can result from anal sex:
There is one way in which anal sex could result in pregnancy: if semen enters the vagina after ejaculation. According to Planned Parenthood, “Since your anus isn’t connected to your reproductive organs, anal sex can’t directly cause pregnancy. But it’s still possible for semen to get into the vagina during anal sex — if the guy ejaculates into or near the anus, and the semen leaks from there down onto the vulva. Fingers and hands could make this more likely, too, by moving semen towards the vulva.”
That means that if someone has anal sex and then ejaculates into the anus or somewhere else near the vagina, sperm could theoretically, accidentally, enter the vagina and cause a pregnancy. If someone ejaculates after anal sex, touches the semen, and then fingers their partner, that could theoretically result in a pregnancy, too. But if semen doesn’t enter the vagina, there’s no chance of pregnancy happening.
Fortunately, this is exceedingly rare, but it is possible. So if getting pregnant is not your intent, be sure to clean up afterwards and take care to avoid semen entering the vaginal canal after anal sex.
If getting pregnant is your intent, however, and you want to maintain a completely vaginal penetration-free lifestyle even while doing so, whether just because you want to avoid going back to vaginal intercourse or because you want to maintain vaginal virginity, you can utilize this method to engage in anal sex as normal, ejaculate anally, and then push it back out while spreading the vagina open for it to run down and into. This technique can work and has been used by those in the anal only lifestyle, though it may require repeated attempts to do so.
Continue reading on Refinery29