The moment due to a force $\boldsymbol{F}$ acting through some location $\boldsymbol{r}_1$ in space is $$\boldsymbol{M}_0 = \boldsymbol{r}_1 \times \boldsymbol{F} \tag{1}$$
Now transfer the moment from the origin 0 to point 1 where the force applies
$$ \boldsymbol{M}_1 = \boldsymbol{M}_0 + (- \boldsymbol{r}_1) \times \boldsymbol{F} = \boldsymbol{r}_1 \times \boldsymbol{F} - \boldsymbol{r}_1 \times \boldsymbol{F} = \boldsymbol{0} $$
So it is true that
The moment caused by a force is zero if the force goes through the point where the moment is measured. The assumption here is that the net force is non-zero $\boldsymbol{F} \neq 0$.
Now consider the more general case of a moment $\boldsymbol{M}_0$ that is due to an offset force $\boldsymbol{F}$ at $\boldsymbol{r}_1$, just as before and a parallel moment $\boldsymbol{M}_1$ about 1. This means that $\boldsymbol{M}_1$ and $\boldsymbol{F}$ act along the same direction, such that $\boldsymbol{M}_1 = h \boldsymbol{F}$ where the scalar $h$ (in distance units) is the "pitch". Then the moment at 0 is
$$ \boldsymbol{M}_0 = h\,\boldsymbol{F} + \boldsymbol{r}_1 \times \boldsymbol{F} \tag{2}$$
The above vector spans $\mathbb{R}^3$ since the cross product $\times$ eliminates all components parallel to the force, but the pitch $h$ includes them. So all possible directions are accounted for.
From $\boldsymbol{M}_0$ and $\boldsymbol{F}$ you can recover where the force is acting $\boldsymbol{r}_1$ and the pitch $h$ (and hence the parallel moment).
$$\begin{aligned}
\boldsymbol{r}_1 &= \frac{ \boldsymbol{F} \times \boldsymbol{M}_0}{\| \boldsymbol{F} \|^2} & h & = \frac{ \boldsymbol{F} \cdot \boldsymbol{M}_0}{\| \boldsymbol{F} \|^2}
\end{aligned} \tag{3} $$
Where $\cdot$ is the dot product, and $\times$ the cross product.
To prove the above, use the vector triple product identity $a \times (b \times c) = b (a \cdot c) - c ( a \cdot b)$ and the self-dot $a \cdot a = \| a \|^2$.
Use (3) into (2)
$$ \begin{aligned}\boldsymbol{M}_{0} & =\tfrac{\left(\boldsymbol{F}\cdot\boldsymbol{M}_{0}\right)\boldsymbol{F}}{\|\boldsymbol{F}\|^{2}}+\tfrac{\left(\boldsymbol{F}\times\boldsymbol{M}_{0}\right)\times\boldsymbol{F}}{\|\boldsymbol{F}\|^{2}}\\
& =\tfrac{\boldsymbol{F}\left(\boldsymbol{F}\cdot\boldsymbol{M}_{0}\right)-\boldsymbol{F}\times\left(\boldsymbol{F}\times\boldsymbol{M}_{0}\right)}{\|\boldsymbol{F}\|^{2}}\\
& =\tfrac{\boldsymbol{F}\left(\boldsymbol{F}\cdot\boldsymbol{M}_{0}\right)-\left(\boldsymbol{F}\left(\boldsymbol{F}\cdot\boldsymbol{M}_{0}\right)-\boldsymbol{M}_{0}\left(\boldsymbol{F}\cdot\boldsymbol{F}\right)\right)}{\|\boldsymbol{F}\|^{2}}\\
& =\tfrac{\boldsymbol{M}_{0}\left(\boldsymbol{F}\cdot\boldsymbol{F}\right)}{\|\boldsymbol{F}\|^{2}}=\tfrac{\boldsymbol{M}_{0}\|\boldsymbol{F}\|^{2}}{\|\boldsymbol{F}\|^{2}}=\boldsymbol{M}_{0}\;\checkmark
\end{aligned}
$$
Which makes the following statement true as well, (also when the net force is non-zero $\boldsymbol{F} \neq 0$)
A rigid body has a non-zero net force $\boldsymbol{F}$ applied and a net moment $\boldsymbol{M}$ applied on some point in space. The moment can be transform to any other point in space, but when transformed along the points of a specific line in space (called the line of action of the force) the resulting moment is minimal and the components are parallel to the line of action. The location of the line is given by (3) and the direction of the line is given by the direction of the force $\boldsymbol{F}$.
To be precise, the point given by (3) is the closest point on the line to the place of summation of moment $\boldsymbol{M}_0$.
See Also