No it isn’t legal. Actually, trading any derivative product outside of those which trade on recognized Indian exchanges is illegal.
Under the liberalized remittane scheme, you can take out upto $275000 a year out of India to invest. It can be used to buy stocks, real estate etc. But you are not allowed to trade any margined/leveraged products.