A lot of toddlers and children eat dirt and never get sick.
As long as the toddler or child is overall healthy and they have a good immune system the toddler or child should not get sick from the dirt they eat.
It's possible for a child or toddler to get sick from eating dirt but very unlikely they will.
I've eaten dirt as a toddler and child and have never gotten sick from it.
I did however once when I was 3 years old get a rock stuck in my mouth which my mom had to get out but other than that I was okay and still am okay.
Some children eat dirt because they are deficient in certain nutrients, such as iron or zinc.
However it doesn't always mean that the child is deficient in those nutrients when they eat dirt.
Sometimes children just eat dirt because they like the taste of it and are enjoying it and children put things in their mouths that adults normally wouldn't.
Children are naturally curious about the new world they are living in because everything is new to them and as they play in the dirt the children are exploring and are interested in the dirt.
So they put the dirt in their mouth because it's new to them.
I used to eat dirt as a 3 and 4 year old years ago and I'm still okay and alive.
I would take crackers outside and put sand on them and eat it.