I have no idea what you imagine might have happened, but it is physically impossible to finger anyone's anus through pants.
In any case, the only risks for HIV in adults are:
1) Having unprotected (no condom) penetrative anal or vaginal sex, OR
2) Sharing IV drug equipment with other IV drug users.
You can't get HIV or any STDs from a finger.
As has been said, and really it's hard to keep repeating it, fingering is NOT a risk. No matter what.