You might forget that the government has everything at its disposal; they have all the tools needed to track anyone, including any transactions they make. Any company operating under the government's jurisdiction will certainly provide information, especially if they say something related to security.
They might even be playing a role. This means that even when a country prohibits any gambling activity, there are still individuals who facilitate it because they profit from it. This is nothing new and is common knowledge, and it's not limited to this space, but it's prevalent in all areas.
People can access and use gambling sites directly or indirectly with some playing around steps in order to bypass restrictions from their governments and Internet service providing companies. They can do this but they must be more careful if gambling is prohibited by existing laws in their countries as bypassing government laws and restrictions is a risky practice.
They can be tracked by Internet service providing companies, the government and can have big legal issue later. It's not about privacy or anonymity but legal issues that are serious.
Of course, if they force themselves to access a casino that doesn't operate in their region due to government restrictions or because the casino refuses to operate in that region, the risk is very high. At any time, we could lose our account (be blocked) by the casino, even though we may still have funds in it.
This is something that should be avoided unless we are prepared for the risks, such as account blocking, withdrawal restrictions on winnings, and so on. The problem is, most people aren't prepared for this, and it can lead to accusations of the casino being a scam.