Leaving aside the fact that in most west African cultures, there can be three or more genders, 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 varying genders and orientations and styles 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 in humans, with maleness, femaleness, or intersex, transgender, or nonbinary, and some tend to be embodied in avatars of a particular gender.
So, as an example, it is entirely possible for a straight, cisgender man to have Oshun as his head or a straight, cisgender woman to have Ogun as her head. Your gender has no bearing on who will choose you.
It may have some bearing on how you express gender or really what is comfortable for you regardless of gender. It’s people around you who may take something a certain way, and this is not your issue but theirs. For example, some children of Ogun who are classed female at birth may appear masculine or butch in some cultures, but in a more understanding culture, they would just be seen as more aggressively feminine than average. So in one place, they would say the reason for one’s expression is the maleness of their head, but in another they would assign the behaviors to the warrior like qualities of their head.
Suffice to say, gender is not something to worry over in African spirituality. Some of the language around it may need updating or clarification, but as we move further away from colonial mentality in general, we also move away from colonial language around gender. Even this very article has changed because of that growth.
Blessings and Ashé!