Yes, playing casino games in online casinos is completely legal. Although gambling and online casino activity are prohibited in some countries, playing in demo mode is legal, as the player is not betting real money.