If you are genetically resistant to androgen, you don't need surgery to combat its effects. If you are not phenotypically male, you won't need surgery either.
All these are cases where the male genetalia would already be present from birth. which would require surgical intervention.
and that's without getting into the complexity of the effects of androgen in utero.