In this work, the flow behavior of foam and its impact on mobility control in displacing oil are investigated using a glass microfluidic device comprising a complex heterogeneous porous medium. The medium, fabricated with a centrally located low permeability zone and two high permeability zones on its sides, is initially saturated with crude oil. A blend of surfactants are used to stabilize CO2 foam in the presence of crude oil. Flow behavior in the microfluidic device is captured using a high-resolution camera. Foam is able to mobilize and recover oil trapped in the low permeability zone by increasing the resistance to flow in the high permeability zones and diverting the surfactant solution into the adjacent low-permeability zone. Foam remains gas-rich in the high permeability zones and solvent-rich in the low permeability zone throughout the experiments. The observed displacement dynamics are explained by characterizing channel geometries and calculating capillary entry pressure values for various fluids and zones of the medium.