Can Bob claim that, because he is homosexual/asexual, he does not find Alice sexually desirable and so cannot be the attacker?
Depends on the very details of what Bob allegedly did.
If, for example, Alice claims that Bob got an erection and penetrated her with his penis, he well could prove that she is lying by somehow proving that he cannot be aroused by females in principle. Merely claiming that he is gay/homosexual won't be enough though. An examination by an expert would be required, and that expert would need to give evidence that Bob is indeed indifferent to women.
If, however, Alice claims that Bob simply groped her and put his hand in her underwear, that would still be sexual assault, and, technically, a person indifferent to women still could do it. So, Bob won't have any defence in this scenario.