Yes, you can get herpes from anal sex. In fact, you can get herpes from any genital contact and barrier methods of contraception (such as condoms) should always be used to prevent STDs. Additionally, if your partner is aware of a herpes outbreak, you should abstain from sexual contact to reduce the likelihood of transmission.