Chemodynamics of green pea galaxies – I. Outflows and turbulence driving the escape of ionizing photons and chemical enrichment