We develop a variational theory of geodesics for the canonical variation of the metric of a totally geodesic foliation. As a consequence, we obtain comparison theorems for the horizontal and vertical Laplacians. In the case of Sasakian foliations, we show that sharp horizontal and vertical Laplacian comparison theorems for the sub-Riemannian distance may be obtained as a limit of horizontal and vertical Laplacian comparison theorems for the Riemannian distances approximations. As a corollary we prove that, under suitable curvature conditions, sub-Riemannian Sasakian spaces are actually limits of Riemannian spaces satisfying a uniform measure contraction property.