Well building a battery factory in EUs worst CO2 polluter kinda makes no sense from an environmental viewpoint. Better to build it in Sweden or France which have a heavy Nuclear/Hydro mix in their grid.
Germany is moving to more renewable sources of energy and Tesla also plans to put solar panels on the rooves of its buildings.
(Also: "EUs worst CO2 polluter" according to what measure and which source?)
Contributing to the greenhouse effect, yes, but that's never been considered exactly "pollution". (Unless the darn kids have fucked up language again. Geroffmyfuckinglawn.)