Eco-friendly inhibitors have attracted considerable interest due to the increasing environmental issues caused by the extensive use of hazardous corrosion inhibitors. In this paper, environmentally friendly PDG-g-PANI/Al2O3 composites were prepared by a low-cost inverse emulsion polymerization for corrosion inhibition of mild steel (MS) and stainless steel (SS). The PDG-g-PANI/Al2O3 composites were characterized by different techniques such as X-ray diffraction (XRD), UV/Vis, and FTIR spectroscopy. XRD measurements show that the PDG-g-PANI/Al2O3 composite is mostly amorphous and scanning electron micrographs (SEM) reveal a uniform distribution of Al2O3 on the surface of the PDG-g-PANI matrix. The composite was applied as a corrosion inhibitor on mild steel (MS) and stainless steel (SS), and its efficiency was investigated by potentiodynamic polarization measurement in a 3.5% NaCl and 1 M H2SO4 solution. Corrosion kinetic parameters obtained from Tafel evaluation show that the PDG-g-PANI/Al2O3 composites protect the surface of MS and SS with inhibition efficiencies of 92.3% and 51.9% in 3.5% NaCl solution, which is notably higher than those obtained with untreated epoxy resin (89.3% and 99.5%). In particular, the mixture of epoxy/PDG-g-PANI/Al2O3 shows the best performance with an inhibition efficiency up to 99.9% on MS and SS. An equivalent good inhibition efficiency was obtained for the composite for 1M H2SO4. Analysis of activation energy, formation enthalpy, and entropy values suggest that the epoxy/PDG-g-PANI/Al2O3 coating is thermodynamically favorable for corrosion protection of MS and exhibits long-lasting stability.