I think asking where someone is from is a pretty universal way to mean, “What ethnicity are you?”.
Usually, you can understand someone’s question based on the context. Your question, for example, “What race are you?” Is not specific enough. I could answer, “I’m not a race, I’m a person, but I enjoy competing in races.”
So just use context clues to understand a persons question and answer the question if you feel like it.