Yes, there are many different types of factories that are safe and the environment could be quite healthy. This depends a lot on the rules and regulations set by the government. The owner of the factory may need to make sure that they implement the right kind of rules.
The rules and regulation of the government doesn't have anything to do with the health situation of any working environment because it is the nature of the business that is going on in a particular factory that is going to determine what affects the health of those who are working in such factories.