Actually way back in The Origin of Family, Private Property, and the State there's a very clear theoretical basis for the start of gender theory. Engels shows that gender and sexuality are, ultimately, social technologies developed under class society for the division of and reproduction of labor. Under different economic conditions you end up with wildly different expressions of gender and sexuality.
Also, Marxist feminism provides a theoretical lens to view queer theory. I definitely vibe with Judith Butler’s concept of performative gender, as a trans woman I can feel the way gender is a social performance as much as it is something internal and personal to me.