Since the moment of inertia is defined as $\int r^2 dm$ where $r$ is the distance of the mass element from the axis, one can move a mass element parallel to the axis, without changing the moment of inertia.
For example, consider a thin rod of length $L$, inclined at an angle $\theta$ to the axis passing through its center of mass. If you move all its particles parallel to its axis to a plane perpendicular to the axis, it will make another rod of length $L \sin \theta$, and you would expect its moment of inertia to be $\frac {mL^2 \sin ^2 \theta}{12}$, in accordance to the formula of the moment of inertia of a rod perpendicular to the axis passing through its COM. After calculation, this does turn out to be the case.
Another example, is a hollow cone of radius $R$, open at its base, with an axis passing through its apex, perpendicular to its base. If you parallelly shift all its particles (rings) to one plane perpendicular to the axis, you get a disc, and the cone's moment of inertia comes out to be $\frac {mR^2}{2}$ by the formula of the moment of inertia for a disc.
However, this only seems to work for linearly varying objects. If you take a circular arc and shift all its particles to a plane, you get a rod again. However, the moment of inertia of the rod is not the same as the moment of inertia of the arc. Similarly, if you take a hemispherical shell and shift its particles to a plane, you get a disc of the same radius, however, the moment of inertia of the hemisphere is not $\frac {mR^2}{2}$
Why is this the case? What is special about linearly varying objects?