Yes , because there is pre- fluids present from the penis.
Keep in mind HIV is spread through these bodily fluids: Blood, semen, vaginal secretions, and breast milk. In the above scenario, there is still a possibility that HIV could have been transferred. Why? Well, with anal sex when the penis enters the anus there is an extremely high chance that the skin around the anus has been tore. When you have torn skin you have created an additional pathway for HIV to enter/exit the body and say he had a small tear or had pre-ejaculated before exiting. My suggestion, get an HIV test. Its better to know than to constantly think about it in the back of your mind. Best of luck.
If you are meeting a lady for the first time with out condom
If you are gay and want to have sex use a condom or do it penis to penis