They most certainly can. Some Orishas have a dual gender, and some have various paths, personas, or character traits that are comfortable for people of the opposite gender in daily life. Spirits in general, unless they are not so much Spirits as alterdimensional beings, don’t have what can be described as a physical gender so much as a “feel”. The way they express themselves will be more associated with maleness, femaleness, or androgyny, and some tend to be embodied in avatars of a particular gender.
So, as an example, it is entirely possible for a straight man to have Oshun as his head or a straight woman to have Ogun as her head. Your gender has no bearing on who will choose you.