Caution: Calculus ahead
The $r$ is the position of the mass particle ${\rm d}m$. It works best in vector form as $$\vec{r} = \pmatrix{x \\ y \\ z}$$
The mass moment of inertia ${\rm I}$ is a 3×3 matrtix (a tensor) defined as follows (first the shape mass and then the shape MMOI):
$$ m = \int {\rm d}m = \int \rho {\rm d}V $$
and
$$ \mathrm{I} = \int \begin{vmatrix} y^2+z^2 & -x y & -x z \\ -x y & x^2+z^2 & -y z \\ -x z & -y z & x^2+y^2 \end{vmatrix} \rho {\rm d}V $$
Example of Sphere
Imagine a solid sphere of radius $R$, where any interior point can be expressed as a function of two angles $\varphi$ and $\psi$ as well as the distance from the center $r$. The position of each ${\rm d}m$ is described using spherical coordinates as:
$$ \vec{r} = \pmatrix{x \\ y \\ z} = \pmatrix{r \cos\varphi \cos\psi \\ r \sin \psi \\ r \sin\varphi \cos\psi} $$
with some looking up online, you will find that in spherical coordinates $${\rm d}V = r^2 \cos \psi\, {\rm d}\varphi\, {\rm d}\psi\, {\rm d}r$$
First, the density is found from
$$ m = \int \rho {\rm d}V = \int_0^R \int_{-\pi/2}^{\pi/2} \int_{0}^{2\pi} \rho r^2 \cos \psi \,{\rm d}\varphi\, {\rm d}\psi\, {\rm d}r = \rho \frac{4}{3} \pi R^3 = \rho V \; \checkmark $$
Now with a lot of math, you can find that
$$\mathrm{I} = \int_0^R \int_{-\pi/2}^{\pi/2} \rho \pi r^2 \begin{vmatrix} 1+\sin^2\psi & & \\ & 2 \cos^2\psi & \\ & & 1+\sin^2 \psi \end{vmatrix} r^2 \cos \psi \, {\rm d}\psi\, {\rm d}r $$
$$ \Rightarrow \;\; \mathrm{I} = \rho \begin{vmatrix} \frac{8 \pi R^5}{15} & & \\ & \frac{8 \pi R^5}{15} & \\ & & \frac{8 \pi R^5}{15} \end{vmatrix} $$
and since $\rho = \frac{m}{\tfrac{4}{3} \pi R^3}$ the above becomes
$$ \mathrm{I} = \begin{vmatrix} \tfrac{2}{5} m R^2 & & \\ & \tfrac{2}{5} m R^2 & \\ & & \tfrac{2}{5} m R^2 \end{vmatrix} \;\; \checkmark $$
So we have derived the mass moment of inertia for a symmetrical sphere
Angular Momentum
Mass moment of inertia is important because it allows us to calculate angular momentum from a rotational velocity vector $\vec{\omega}$
$$ \vec{L}_{\rm com} = \mathrm{I}_{\rm com} \vec{\omega} $$
where ${\rm com}$ is the center of mass.
Additionally, the angular momentum about a different point is
$$ \vec{L} = \mathrm{I}_{\rm com} \vec{\omega} + \vec{r}_{\rm com} \times \vec{p} $$
where $\vec{p} =m \vec{v}_{\rm com}$ is the linear momentum.
So the complex integral around a shape to get the mass moment of inertia only needs to happen once, and then you just use the 3×3 matrix is the equations above to get the angular momentum vector.
Well almost. In reality the mass moment of inertia is defined in a coordinate system aligned with the body geometry (such as x-axis is along the long dimension for example) and to use it in dynamics it has to be transformed into an inertial world coordinate frame. See this post on how this is done.
PS. To find the infinitesimal volume in any coordinate system, describe the position of the volume in terms of thre parameters, like $\vec{\rm pos}(t,s,e)$ and define the infinitesimal volume as
$$ {\rm d}V = \frac{ \partial \vec{\rm pos}}{\partial t} \cdot \left( \frac{ \partial \vec{\rm pos}}{\partial s} \times \frac{ \partial \vec{\rm pos}}{\partial e} \right) {\rm d}t\, {\rm d}s\, {\rm d}e $$
where $\cdot$ is the vector dot prodcut, and $\times$ is the vector cross product.