The confusion here comes from the fact that there are two different notions both called "metric" and two different notions, both called "an isometry" or "an isometric embedding."
(1). In the theory of metric spaces. A metric, or a distance function, is a map $X\times X\to {\mathbb R}_+$ satisfying certain conditions, such as symmetry, triangle inequality, etc. Accordingly, a map $f: (X, d_X)\to (Y, d_Y)$ is an isometry (more precisely, an isometric embedding) in the sense of metric geometry if
$$
d_Y(f(x_1), f(x_2))=d_X(x_1, x_2), \forall x_1, x_2\in X.
$$
(2). In Riemannian geometry. A metric or, rather a Riemannian metric is a certain tensor (or a tensor field) on a differentiable manifold $M$. More precisely, a Riemannian metric $g$ on $M$ is a collection of inner products on tangent spaces $T_pM, p\in M$, satisfying certain smoothness condition. If $M$ happens to be connected then $g$ defines the Riemannian distance function $d_g$ on $M$:
$$
d_g(x,y)= \inf_{c} \int_0^1 g(c'(t), c'(t))^{1/2}dt,
$$
where the infimum is taken over all (say, smooth) paths $c: [0,1]\to M$ connecting $x$ to $y$. Then $(M, d_g)$ is a metric space in the sense of (1).
Example. $M={\mathbb R}^n$. Then all tangent spaces $T_xM$ are canonically isomorphic to ${\mathbb R}^n$. Then taking an inner product $\langle \cdot, \cdot \rangle$ on ${\mathbb R}^n$ we obtain a Riemannian metric $g_0$ on $M$.
The corresponding notion of an isometric embedding in Riemannian geometry is:
Given two Riemannian manifolds $(M_1, g_1), (M_2,g_2)$, a smooth map $f: (M_1, g_1)\to (M_2,g_2)$ is called a (Riemannian) isometric embedding if it is a topological embedding and for every $x\in M_1$ and any two tangent vectors $u, v\in T_xM_1$, we have
$$
g_2(df_x(u), df_x(v))= g_1(u,v).
$$
Now, Nash isometric embedding theorem is about Riemannian metrics and Riemannian isometric embeddings. It states:
Suppose that $(M,g)$ is a $C^k$-smooth $m$-dimensional Riemannian manifold, $k\in [3,\infty]$. Then there exists a $C^k$-smooth isometric embedding
$$
f: (M, g)\to ({\mathbb R}^n, g_0)
$$
for $n=m(3m+11)/2$.
Note that if $M$ is connected, this theorem does not claim that $f$ preserves the Riemannian distance function, i.e. it does not hold, in general that
$$
||f(x)-f(y)||=d_g(x,y), x, y\in M
$$
where $||\cdot||$ is the Euclidean norm.