Generally yes. There are some bishops who object to this and make the person choose the variant of the name that fits their own gender. For example, a girl who wants to take the name John might be told to take the name Joan, or Joanna, or Johnna. Other bishops might let her take the name John.