Praveen,
If the factory where the work is done is covered under esic, then it is necessary to cover the contract workers under esic. If the contractor does not have a esic account, then the company mist cover the workers under its own code.
Where the factory is not covered under esic, then the contractor or the principal employer must have workman compensation and accident insurance cover. If they don't have it, in case if an accident the compensation needs to be paid by the company, which can be very expensive,
Paying esic or insurance cover under company code rather than contract code is not a good practice as the courts may construe this evidence that the workers are direct employees