Its not legal. Neither you can do this under the Factories Act or Industrial Employment Standing Order. Also this will be violation of Shops and Establishment Act. You can also get into problem for violating agreed terms of contract. So do not indulge in such practices without properly compensating the employee and with his or her assent.