In most cases, yes, although there are exceptions, including these:
Hemorrhoids are more common and tend to become larger as pregnancy progresses. If you do have hemorrhoids – and if they’re bleeding and you have anal sex – you can lose a considerable amount of blood, which can endanger you and your baby.
If you have placenta previa (in which the placenta covers all or part of your cervix), anal sex may cause trauma to the placenta. This can happen as the penis in the anus thrusts against the cervix through the recto-vaginal septum, or if you have contractions as a result of orgasm. The trauma can cause bleeding that’s significant enough to endanger the pregnancy.
Just as when you’re not pregnant, you should never go from anal to vaginal sex without first washing his genitalia and changing condoms if you’re using one. Otherwise you put yourself at risk for bacterial vaginitis, and there’s some concern that this infection can cause preterm labor or make your water break early.
Unless you’re in a monogamous relationship and know that you and your partner are HIV -negative, you should always use a condom, because HIV is a sexually transmitted infection (STI) that can infect you and your baby.