It depends on the game. Some are specifically designed to be played without an account, while others require one.
For browser game portals like Miniclip or Addicting Games, creating an account is optional. However, games like RuneScape or AdventureQuest, as well as many titles you buy in stores, require an account to play online. It's usually stated clearly whether an account is needed.