Let $M \subset \mathbb{R}^p$ be a Riemannian submanifold. In what follows, when we talk about a Lipschitz function $f$ on $M$, namely $f: M \to \mathbb{R}$, we will assume there is a $L > 0$ so that:
$$ \lvert f(x) - f(y)\rvert \leq Ld_M(x,y)\quad \forall x, y \in M. $$
My question is: What is either a necessary and sufficient condition (preferred) OR if not possible, then at least a sufficient condition that every Lipschitz function on $M$ can be extended to a Lipschitz function on $\mathbb{R}^p$? So to write mathematically, what is or are sufficient condition(s) on $M$ so that for every Lipschitz $f: M \to \mathbb{R}$, there exists an extension $\tilde{f}$ of $f$ so that $\tilde{f}$ is also Lipschitz (possibly with a bigger Lipschitz constant)?
On the other side, what is a necessary and sufficient condition on $M$ so that every Lipschitz function on $\mathbb{R}^p$ restricts to a Lipschitz function on $M$? I feel like for a compact manifold, this will be true, as there we will have:
$$C_1\lVert x- y\rVert \leq d_M(x,y) \leq C_2\lVert x-y\rVert,$$
because the exponential map is smooth, so the norm of its gradient will have an upper and a lower bound on compact $M$, resulting in the above inequality. Is it true though?