Foam has been widely used as a proven technology in enhanced oil recovery by improving the mobility of the injected gas. However, its further application has been retarded owing to the limited stability in high salinity, high temperature and crude oil conditions. Traditional agents for foam stabilization including surfactants, polymers are unable to stabilize foam for long term under harsh conditions. In this work, the nanogel particles with high viscoelasticity were synthesized to stabilize foam for more than one year through a free radical reaction method using α-starch, acrylamide, N,N′-methylene bisacrylamide, potassium persulfate. The diameter of nanogel particles was 30 nm. The stability of foam stabilized by nanogel particles was evaluated by using foam volume and T90 as indicators at temperature of 30–120 °C, salinity of 0–240 g/L and oil percentage of 0–50 wt%. Moreover, the rheological properties of foam were also measured to study the mechanisms of foam stability under different conditions. The results demonstrated that foam stabilized by nanogel particles exhibited excellent resistance to high salinity, high temperature and crude oil. Thus, the synthesized nanogel particles can be used as a potential candidate for stabilizing foam in enhanced oil recovery.