The iron-based catalysts derived from modified ZIF-8 were prepared, characterized, and applied to CO2 hydrogenation reaction. The addition of iron and iron/potassium evidently tuned the pyrolysis behavior by forming carbon encapsulated iron nanoparticles and metal nanoparticles inserted hollow sphere, respectively. FeZn-NC and FeZnK-NC exhibited high activity with 29.3% and 34.6% CO2 conversion, respectively. More importantly, the selectivity to value-added hydrocarbons (i.e., C2–C4 = and C5+), which are of great importance to chemical industry and energy, was prominent over these two catalysts, and higher than 54 C-mol%. The FeZn-NC with carbon-encapsulated iron nanoparticles showed a remarkable stability for 126 h on stream, suggesting a promising prospect for industrial application.