Superconductivity develops in bulk doped SrTiO3 and at the LaAlO3/SrTiO3 interface with a dome-shaped density dependence of the critical temperature Tc , despite different dimensionalities and geometries. We propose that the Tc dome of LaAlO3/SrTiO3 is a shape resonance due to quantum confinement of superconducting bulk SrTiO3. We substantiate this interpretation by comparing the exact solutions of a three-dimensional and quasi-two-dimensional two-band BCS gap equation. This comparison highlights the role of heavy bands for Tc in both geometries. For bulk SrTiO3, we extract the density dependence of the pairing interaction from the fit to experimental data. We apply quantum confinement in a square potential well of finite depth and calculate Tc in the confined configuration. We compare the calculated Tc to transport experiments and provide an explanation as to why the optimal Tc's are so close to each other in two-dimensional interfaces and the three-dimensional bulk material