It isn’t illegal per se, but it certainly isn’t advisable. You will not be criminally charged if you’re found cheating in an online casino, but there will be repercussions. For instance, you’re likely to get permanently banned from the casino. Naturally, they will also confiscate all your winnings.