See Shulchan 'Aruch OC 302:6, 8, as well as the Mishna B'rura ad loc. (English link) and Bei'ur Halacha s.v. "או על מנעליו" and "אין מגרדין".
In summary, there doesn't seem to be a problem with wiping muddy shoes on a doormat. There is a problem with rubbing off the mud on the dirt ground, lest your shoe mud fill in a depression in the dirt. If you have leather soles, there is a problem with scraping your shoes against a sharp (or, according to the Magen Avraham, even dull) metal edge, due to the prohibition of smoothing leather (m'macheik). A minority opinion prohibits wiping the mud on a stone wall, as it could seem like adding mortar to the stones for construction purposes (a wooden wall, for example, would pose no halachic problem).
According to the Mishna B'rura, one may readily follow the lenient opinion permitting wiping off wet mud from a leather sole on a dull or smooth metal threshold, provided one rubs off the mud gently. The Bei'ur Halacha adds that it is preferable to be stringent in this regard with dry mud (since a person would be more prone to scrape his leather sole more vigorously to get the mud off), although he cites the P'ri M'gadim that one may also be lenient with dry mud if the mud causes him distress.
There is another reason to potentially be more strict about dry mud than wet mud, regardless of whether one's soles are made of leather or rubber. According to Rabbeinu Peretz, causing the dry mud to flake off into small pieces or into powder would be a problem of tochein. Nevertheless, as mentioned above, the P'ri M'gadim says one may be lenient if the mud causes him distress.
If part of the shoe is made of fabric, it would also probably be prohibited to rub the fabric to remove mud stains in order to make the fabric look clean (see Mishna B'rura 302:36, see also the beginning of siman 302). However, merely scraping tangible wet mud off the fabric is permissible. (The earlier proviso about grinding dry mud and tochein would also apply here).