Conformable matrices
Two matrices must be conformable if they are to be multiplied. Their dimensions must be compatible. For example,
$$
\mathbf{AB} = \mathbf{C}
$$
we must have
$$
\mathbf{A} \in \mathbb{C}^{m\times \color{red}{n}}, \qquad \mathbf{B}\in \mathbb{C}^{\color{red}{n}\times p}
$$
The number of columns in $\mathbf{A}$ must match the number of rows in
$\mathbf{B}$. The resulting matrix looses knowledge of the dimension $n$, and
$$
\mathbf{C} \in \mathbb{C}^{m\times p}
$$
Think of it this way: if $\mathbf{A}$ is mom, and $\mathbf{B}$ is dad, the child matrix $\mathbf{C}$ has mom's height and dad's width.
Dot products
We can see the need for conformability we looking at matrices as a collection of vectors. The matrix on the left, $\mathbf{A}$, has $m$ row vectors of length $\color{red}{n}$; the matrix on the right, $\mathbf{B}$, has $p$ column vectors of length $\color{red}{n}$
$$
\mathbf{A} =
\left(
\begin{array}{cc}
r^{T}_{1} \\
r^{T}_{2} \\
\vdots \\
r^{T}_{n} \\
\end{array}
\right),
\qquad
\mathbf{B} =
\left(
\begin{array}{cccc}
c_{1} &
c_{2} &
\dots &
c_{n}
\end{array}
\right)
$$
The matrix product is expressed in terms of dot products:
$$
\mathbf{AB} =
\left(
\begin{array}{cc}
r^{T}_1 c_{1} & r^{T}_1 c_{2} & \dots & r^{T}_1 c_{p} \\
r^{T}_2 c_{1} & r^{T}_2 c_{2} & \dots & r^{T}_2 c_{p} \\
\vdots & \vdots & & \vdots \\
r^{T}_m c_{1} & r^{T}_m c_{2} & \dots & r^{T}_m c_{p} \\
\end{array}
\right)
=\mathbf{C}
$$
Your example:
$$
\left(
\begin{array}{cc}
1 & 2 \\
3 & 7 \\
\end{array}
\right)
%
\left(
\begin{array}{c}
1 \\
5 \\
\end{array}
\right)
=
\left(
\begin{array}{c}
1 \cdot 1 + 2 \cdot 5 \\
3 \cdot 1 + 7 \cdot 5 \\
\end{array}
\right)
=
\left(
\begin{array}{c}
11 \\
38 \\
\end{array}
\right)
$$