Yes, card counting is not illegal in casinos, but casinos do have the right to refuse service to anyone, and they may take actions to prevent it. While card counting itself doesn't break any laws, casinos can ask a player to leave, ban them from the casino, or even revoke their winnings if they suspect or detect card counting. Casinos often employ various methods, such as surveillance and employing pit bosses, to watch for players using card counting techniques. Additionally, they may alter the rules of the game (such as using multiple decks) or shuffle the deck more frequently to make card counting more difficult. So, while it's not against the law, casinos can take steps to discourage or stop it.