Yes, it is absolutely legal. That is provided that online gambling is permitted according to the legislation of your country. In simple words, if you can gamble online with a regular (fiat) currency, you can do it with TRX too.