Strictly speaking, there is no such thing as a countable or uncountable noun. There are nouns that are predominantly used as countable, or as uncountable, but it is almost always possible to invent a sentence in which a word takes on the opposite role to its usual one.
The same is true for parts of speech such as "nouns", "adjectives", and "adverbs". Although words often belong predominantly to one of these categories, it is most often possible to imaginatively use it in other roles.
So, yes, "dirt" is predominantly an uncountable noun. That is why we normally speak of "much dirt" rather than "many dirts". However, YOU ARE IN CHARGE. If you wish to think of "dirt" as something countable you are free to do so, and it makes perfectly good sense to do that if you want. For instance you might have three piles of dirt: a red pile of clay, a sandy pile, and a fertile one. In that situation, it makes perfectly good sense to say you have three dirts. You are in charge!
I once tried to think of a noun that couldn't possibly be uncountable. The best example I could find was "point". I find it extraordinarily difficult to think of an uncountable way of using "point" because, as Euclid pointed out, a point has no parts.