I think a person can write whatever race or nationality they want to, but have to understand that there is going to be a difference in culture. For example, I’m white and if I was going to write about a Mexican-American, I’m going to have to understand that they are probably bilingual and Mexican families care a lot about family. As a writer, I’m going to have to understand that even if the character grew up in America, their family probably still holds onto Mexican ideologies. Another example that could cause problems are cultures that have other ideologies than what the writer has. For example, Germany’s views are that they care more about what is better for society than the individual. Whereas in America, we care a lot about how the individual feels over what is good for society as a whole.
When writing about a different race or nationality, you have to take in account that their culture is probably different than yours.