As a reference, in addition to the classical ones cited above, I can recommend the following:
Agrachev, Andrei; Barilari, Davide; Boscain, Ugo, A comprehensive introduction to sub-Riemannian geometry., ZBL07073879.
The proof of the Chow-Rashewski theorem is in Section 3.2. An electronic version of the book is also freely available online (https://www.imj-prg.fr/~davide.barilari/ABB-v2.pdf)
The idea is of course the same as the one in the proof given above by Piotr Hajlasz, but I think that the presentation in the book is more geometric and concise.
Concerning your last question (everywhere vs almost everywhere). Horizontal curves might not be differentiable at certain points (e.g. think at a curve with a corner). In order to define a length, the tangent vector of an horizontal curve $\gamma:[0,1]\to M$ should be defined almost everywhere on $[0,1$]. There are then several regularity classes of curves which one might use (all used in the literature):
- $\gamma \in W^{1,1}$ that is absolutely continuous curves (the largest class one can think of)
- $\gamma \in W^{1,2}$ that is absolutely continuous curves whose tangent vector is $L^2$ (slightly smaller, but natural in view of minimization of the energy functional, and furthermore the space of "admissible velocities" is Hilbert)
- $\gamma \in W^{1,\infty}$ that is curves that are locally Lipschitz in charts (as I comment blow, also this class is natural as one can always reduce to this case when dealing with the length-minimization problem)
in any case, of course, the tangent vector, which is defined almost everywhere, is required to belong to the sub-Riemannian distribution. The proof of the Chow-Rashevskii theorem shows that connectivity is achieved by horizontal curves that are concatenation of a finite number of smooth curves, which belongs to all the classes above (so the choice of regularity class above is irrelevant).
It turns out that also the sub-Riemannian distance (defined as the infimum of the length of horizontal curves between two points) does not depend on the choice of the regularity class. This is due to the fact that, within a given regularity class ($W^{1,1}$, $W^{1,2}$ or $W^{1,\infty}$) one can always reparametrize the curve, without changing its length, in such a way that the reparametrized curve has constant speed. This is proved in Section 3.6 of the book by Agrachev, Barilari and Boscain.