I would require more information on whether you are referring to a corporate office or a manufacturing facility such as a factory. Certain things would change in terms of the legal consequences of imposing penalties, as offices would be covered by the Shops and Establishments Act, and factories would be covered by the Factories Act.
Assuming you are referring to a corporate office, please draft an email that will be circulated to all employees clarifying the dress code with example pictures, if necessary. Formals or business casuals are usually preferred (with women having the option to choose between Western or Indian formals) in Indian corporate offices. Please ask respective department heads to also have a talk or send an email to their subordinates specifying the importance of dress code adherence.
Steps to Address Dress Code Violations
Now, in case of violations, the following steps can be taken:
1. If the violation is, for example, from an employee in the Finance department, have a session on the dress code calling all finance employees (for 15-20 minutes). This is a general way of addressing the issue, and the point is sure to be driven home.
2. In case of a second violation, please ask the immediate manager of the employee or department head to have a word.
3. For a third violation, HR and the department head can give a joint warning; please document the same in an email.
4. In the case of a fourth violation, please have the department head and HR explain the impact of non-compliance with central office policies on appraisals and thereby on hikes and appraisals.
I do not believe in the spirit of holding employees' salaries, sending them back home, or the dress code affecting their performance feedback. However, within reason, if it is affecting the morale of other employees, then take stringent action as necessary.