If I have anal sex, can I get pregnant?

No. Not unless his penis rubs against the tissues at the vaginal opening or his penis penetrates the vagina. There would need to be either pre-ejaculate or ejaculate as well.