Let vectors \(\textbf{v}\) and \(\textbf{u}\) be defined as follows:
$$ \textbf{v} = \begin{bmatrix} v_1 \\ v_2 \\ v_3 \end{bmatrix} \quad \textbf{u} = \begin{bmatrix} u_1 \\ u_2 \\ u_3 \end{bmatrix} $$
The dot product \(\textbf{v} \cdot \textbf{u}\) is defined as follows:
$$ \textbf{v} \cdot \textbf{u} = v_1u_1 + v_2u_2 + v_3u_3 $$
Since the multiplication of two numbers is a commutative operation:
$$ \begin{align} \textbf{v} \cdot \textbf{u} &= v_1u_1 + v_2u_2 + v_3u_3 \\ &= u_1v_1 + u_2v_2 + u_3v_3 \end{align} $$
By definition of the dot product:
$$ \begin{gather} u_1v_1 + u_2v_2 + u_3v_3 = \textbf{u} \cdot \textbf{v} \\ \therefore \textbf{v} \cdot \textbf{u} = \textbf{u} \cdot \textbf{v}\end{gather} $$
A similar proof can be used for other dimensions.