That depends on the character. Some characters have specific focal points - themes, places, stories or beliefs they are tied to - which do not work well when gender/race is changed. Other are pretty clay-like and can be swapped without much issue.
To take a few examples:
- Batman has to be rich...