Hi,
When we convert chemical energy into electrical energy then electrical energy is not created, it is formed from chemical energy which implies that there is no creation of new energy. Only conversion takes place i.e., Chemical energy gets converted to electrical energy. Hence we can say that one form of energy gets converted to another form of energy.
Hence law of conversion of energy is applicable in this situation also.
Regards