Intuitive answer
To compute the moment of inertia "numerically," we can imagine discretizing our object into a set of point masses which all have the same, small mass. Let's say the total mass is $M$ and we break the object into $N$ discrete point masses; then each point mass will have mass $M/N$.
Then the moment of inertia can be calculated as a sum over the discrete masses
\begin{equation} I = \sum_{i=1}^N r_i^2\frac{m_i}{N} \end{equation}\begin{equation} I = \sum_{i=1}^N r_i^2 m_i = \sum_{i=1}^N r_i^2 \frac{M}{N} \end{equation}
Now to take the continuum limit, we want to take $N\rightarrow \infty$. The sum will turn into an integral
\begin{equation} I = \int {\rm d} m\ r^2 \end{equation}
This gives us an idea of what is going on; the integral refers to a sum over infinitesimal mass elements, and is telling us to sum the product of the infinitesimal mass in the element and the distance of that mass element from the axis of interest. Of course this "derivation" is a little sloppy, so let us be a bit more precise and increase our level of sophistication.
More rigorous answer
(Caveat: When I say "rigorous," I don't mean full mathematical rigor, more like introducing some words and describing things at a physics level of rigor) You can interpret ${\rm d} m$ as being a measure. In other words, we have a function of space which tells us how much density is located in each region of space.
Let's suppose we have a 3d object, and call this density function $\rho(\vec{x})$. Then the mass contained in a small region of space (our measure on space), is related to the density function, by
\begin{equation} {\rm d} m = \rho(\vec{x}) {\rm d}^3 x \end{equation}
The moment of inertia integral becomes
\begin{equation} \int |\vec{x}|^2 {\rm d} m = \int |\vec{x}|^2 \rho(\vec{x}) {\rm d}^3 x \end{equation}
This is an unambiguous formulation of the integral that can be used in a calculation.
Now some philosophical comments:
One advantage of the ${\rm d m}$ notation, is that it does not commit to what kind of region you are integrating over. The expression $\int r^2 {\rm d}m$ is correct whether we are dealing with a 1-dimensional rod, a 2-dimensional disk, or a 3-dimensional object. Of course, to actually calculate the integral in practice, we need to relate ${\rm d}m$ to a line, surface, or volume integral using the appropriate density function.
Therefore the notation is useful as an abstract way to express the moment of inertia, but is not useful as a starting point for a calculation without adding additional information.