$[ x, y, z ] \in \mathbb{R}^3$ is a point or a vector.
A point has a position but no direction.
A vector has a direction but no position.
$a = [ a_1, a_2, \ldots, a_n ]^T$
$b = [ b_1, b_2, \ldots, b_n ]^T$
$a \cdot b = \langle a, b \rangle = \sum_i a_i b_i$
$(x,y) \cdot e_1 = 1 x + 0 y = x$
$(x,y) \cdot e_2 = 0 x + 1 y = y$
This relies on $|e_1| = |e_2| = 1$.
For rotation $R$, let $u' = R u$ and $v' = R v$:
Note that the dot product $a \cdot b$ is the same as the matrix product $a^\mathsf{T} b$.
$\begin{array}[t]{rl} u' \cdot v' & = R u \cdot R v \\ & = (R u)^\mathsf{T} (R v) \\ & = (u^\mathsf{T} R^\mathsf{T}) (R v) \\ & = u^\mathsf{T} (R^\mathsf{T} R) v \\ & = u^\mathsf{T} v \\ & = u \cdot v \end{array}$.
This works because $R$ is a rotation matrix and $R^\mathsf{T} = R^{-1}$.
Note that $|u| |u| = u \cdot u$.
Therefore, ${v \cdot u \over u \cdot u} u$ is the vector that is the projection of $v$ onto the line of $u$, and is the closest we can get to $v$ using only a multiple of $u$.
$\begin{array}{rl} \cos \theta & = {\text{adjacent}
\over \text{hypotenuse}} \\ & = {v \cdot \frac{u}{|u|}
\over |v|} \end{array}$
So $u \cdot v = |u| |v| \cos\theta$.