Understanding the dynamics of foam flow in porous media is of great importance to many industrial processes such as soil remediation, CO2 sequestration, and enhanced oil recovery. The efficiency of the foam-liquid displacement depends on several parameters relating to the surfactant properties, boundary conditions, and the transport properties of the porous media. Thus, it is essential to understand the dominant mechanisms controlling foam flow in porous media. In this dissertation, several parameters such as the surfactant properties, external conditions for instance gravitational effet, the pore size of porous media and the aperture variation of the fracture have been shown to influence the dynamics of foam flow in porous media. The obtained results revealed the adverse effect of fluid separation by gravity segregation and fingering of the gas phase into the foam bank at high flow rates on the efficiency of the foam displacement in porous media. However, our results showed pore size of porous media has a stronger influence on foam stability compared to the effect of type of oil. Also, it was found that there is no meaningful correlation between the stability of oil in bulk-scale to pore scale. The obtained results in fractured media showed that fracture wall roughness strongly increases the foam's apparent viscosity and shear rate. Moreover, foam bubbles traveling in regions of larger aperture exhibit larger velocity, size, a higher coarsening rate, that are subjected to a higher shear rate. Additionally, in this dissertation, the effect of the synergy between different surfactant types and nanoparticles on the stability of foam was investigated. The results reported in this dissertation shed new insight into the behavior of foam in porous media. The results of this dissertation have been published in 3 peer-reviewed journal papers with another one under review.