Your analogy doesn’t work. “Illegal alien” is a technically accurate phrase to describe someone from a foreign country who is in the U.S. without permission. It may sound harsh, but it is a factually accurate description. “Gook” is an insulting term for a Korean person. It is meant to be an insult. It serves no other purpose other than to be an insult.
You have the right to use insulting terms for other people, or support those who do. But the fact that you would choose to do so, for no apparent reason, says more about you than about those whom you disparage.
That Thai officer was a very good friend who hung around with me and my friends. He used to go downtown to the R& R bars with us and pretend to be from Hawaii. He of course also pretended to did not understand the Thai which the bar girls were using to discuss the Johns.
My 3rd ex wife who was Pinay, got a kick out of it when I explained our term for her people. FLIP isn't exactly nice.