It is not illegal to use the Martingale system on betting sites, but you should only choose games or bets with 1:1 odds. You can play red/black or odds/evens in European Roulette, for example, or pass/don’t-pass and come/don't-come bets if you play craps.