The term 汉奸 probably only works for Han Chinese traitors, but what about other '汉's?
Sure, look at https://www.youtube.com/watch?v=SA9Dr7M2hlc for an example, Mongolian 乌兰托娅 singing about 汉子. While 汉 is the dominant ethnicity, in general it just means man.
男子汉 means a manly guy, a strong man, or a courageous fighter.
The grammar doesn't seem natural in Chinese. It actually originated in a foreign language and borrowed to Chinese. Here is some text about its origin:
It can be used for people of any ethnicity in China (not just 汉族，but also 满族、蒙古族, etc). So foreigners can also use the word without any problem.
Can you apply 男子汉 and 女汉子 to non-Chinese?
Originally the 汉 in those words mean 'man of Han dynasty', however, today that connotation is completely gone. You can apply these words on people with any nationality or ethnicity.
汉 has different meanings in these phrases.
In 汉奸，汉 stands for the ethnicity (or probably the nationality), but in 男子汉 and 女汉子，汉 or 汉子 means masculinity. I am not sure of the relation between these two meanings, but they are surely different.
男子汉 means a man whose body or inspire is strong and who has no fear to face the difficulties.But the word"女汉子" means different.First of all, it is a word about the girl,and second, it means the girl acts like a man.