It is not illegal but it is frowned upon. You can get banned from a casino if you get caught.