An idiom is a phrase that has a figurative meaning that is different from the literal meaning of the words. For example, "kick the bucket" is an idiom that means "to die."
While "caked in mud" could be used figuratively to describe someone who is very dirty or messy, it's not considered a true idiom.