No matter what country you are in, I think that in the modern world it is very easy to bypass absolutely any ban on gambling.
For example, even if physical casinos are closed all over the country and they are monitored to make sure that no one can open them underground, players will always be able to turn on a VPN and go to an online casino to play absolutely calmly, and money can be withdrawn even in cryptocurrency, which can then be converted and there will be no problems with receiving a transfer for winnings on a card.
It would also depend on the availability of casinos which are VPN friendly and whether those casinos are regulated and comply with banning people from countries in which gambling is forbidden.
I would personally not risk it, though, I would picture myself living in a country where gambling is outlawed, I decide to go online and activate a VPN to gamble, I would be at the mercy of the casino staff if I ended up winning a significant amount of money. They could alledge I cannot withdraw by winning because I am from a country where gambling is illegal and yadda yadda yadda.
On those cases it sounds even safer to go to some underground casino and try one's luck there, at least you know you will get your money in case of getting lucky during your session.
It is a delicate topic, it would be interesting enough to see if the most religiously strict countries like Saudi Arabia enforce their ban of gambling also on the internet.