Can I get trichomoniasis by anal sex?

Yes. This answer depends on the location of the infection in the partners. If there is only a vaginal infection, it is doubtful that transmission to the male would occur with anal sex alone.