If $v$ and $u$ are vectors then the dot product is $vu^t$ or equivalently $v^tu$, $uv^t$ or $u^tv$ where $x^t$ is the transpose of $x$, i.e. switch the rows and columns, so that
$$(x_1, x_2, x_3, ...)^t = \begin{pmatrix}
x_1\\
x_2\\
x_3\\
.\\
.\\
\end{pmatrix}$$
and the dot product of $u$ and $v$ is then seen to be
$$(u_1, u_2, u_3, ...)\begin{pmatrix}
v_1\\
v_2\\
v_3\\
.\\
.\\
\end{pmatrix} = u_1v_1 + u_2v_2+ u_3v_3 + \ldots$$
If you now rotate the coordinate system with a rotation matrix $R$ then the components of a vector $u$ become $uR$, and he components of the transposed vector $v^t$ become $R^tv^t$ (where $R^t$ is the transpose of $R$ given by $R^t_{i, j} = R_{j, i}$), so that the dot product in the new coordinates is $uRR^tv^t$.
A property or rotations is that their matrices are orthogonal and their transpose is equal to their inverse so that $R^t = R^{-1}$, so the scalar product is = $uRR^{-1}v^t$ and $RR^{-1} = I$ (the identity matrix), so that $uRR^tv^t = uRR^{-1}v^t = uIv^t = uv^t$, i.e. the dot product is invariant under rotation.
That may be a bit much at high school level, so perhaps a demonstration in 2-D would help.
A rotation matrix has the form
$$\begin{pmatrix}
\cos\theta& -\sin\theta\\
\sin\theta & \cos\theta
\end{pmatrix}$$ where $\theta$ is the angle of rotation.
$u$ rotated is $$(u_x, u_y)\begin{pmatrix}
\cos\theta& -\sin\theta\\
\sin\theta & \cos\theta
\end{pmatrix} = ([u_x]\cos\theta + u_y \sin\theta], [-u_x\sin\theta + u_y\cos\theta])$$ and similarly for $v$, so that $$uv^t = ([u_x\cos\theta +u_y\sin\theta]\cdot[v_x \cos\theta + v_y \sin\theta] + [-u_x\sin\theta + u_y\cos\theta]\cdot[-v_x\sin\theta + v_y\cos\theta])$$
and when you multiply it out and gather the terms you end up with $(u_xv_x + u_yv_y)(\cos^2\theta + \sin^2\theta)$, i.e. the same $(u_xv_x + u_yv_y)$ as you have without the rotation.