Not illegal.
Vanilla cards are virtual credit cards. These virtual credit cards can be bought in convenience stores abroad, and they contain US dollars.
No matter what type of card it is, there are different exchange rate differences in the country. Most domestic friends who are engaged in foreign gift cards make profits from the exchange rate difference.