Yes, questioning one’s sexuality can be a theme in OCD.
It may take several forms, such as heterosexual individuals having obsessions about being gay, homosexual individuals having obsessions about being straight, or thoughts about other sexual themes, such as sex with inanimate objects or with animals or pets.
The defining characteristic of OCD with these themes is that the thoughts are unwanted versus desired or even sought after. Also, for individuals with OCD, compulsions are done to neutralize the thoughts, instead of actively seeking out encounters with the objects or people or animals in the thoughts.
Note that the thoughts about sexual orientation need not imply that there is anything wrong with being hetero or homosexual.
Instead, the obsessions have to do with the perceived undesirability of either having the thoughts or of being gay or straight for that person.