  We establish a Rademacher type theorem involving Hamiltonians $H(x,p)$ under
very weak conditions in both of Euclidean and Carnot-Carath\'eodory spaces. In
particular,$H(x,p)$ is assumed to be only measurable in the variable $x$, and
to be quasiconvex and lower-semicontinuous in the variable $p$. Without the
lower-semicontinuity in the variable $p$, we provide a counter example showing
the failure of such a Rademacher type theorem. Moreover, by applying such a
Rademacher type theorem we build up an existence result of absolute minimizers
for the corresponding $L^\infty$-functional. These improve or extend several
known results in the literature.
