Or maybe that depends from country to country. I think there are countries gambling is really discourage or it's a sin, so casinos are not serving the country. In my country, gambling is regulated, so I can't say it's illegal because there are casinos that are given a license to operate but when I visit to some popular online casino, I can see that they don't serve my country, some other casinos are not even accessible, so it's a case to base basis I guess.
I still believe that it is depending on the casino and the license only. Although gambling is 100% illegal and considered as a sin, casinos may still serve the country.
Again I'll use my country as example where gambling is illegal and it is also considered as a sin but the fact is that there are so many online gamblers in my country.
But there are also some casinos that not accepting gamblers from my country, that's why I believe the decision is made by the casino which at the same time also following the license.