There is a tiny pile of food on the floor. The food includes some cooked rice and fish. The pile is much smaller than your foot.
Would you say "don't step in or on that tiny pile of food"?
I agree that if the size of the pile of food is much bigger than the size of your foot, then we can use "IN", for example, "don't step in that big pile of food".
But if the size of the pile is much smaller than your foot, then you "don't step in it" but flatten it and cover your foot "ON" it.
Some native speakers say we don't care about the size. If the substances are soft or liquid form, then just use "IN" no matter how big or small the substance is. Others say if the substances are soft or liquid form and smaller than our foot, then use "ON", but if they are bigger than our foot, then use "IN".