Calculate DC motor frequency
The PWM frequency supplied to a (presumably) brushed DC motor needs to be high enough that the combination of mechanical inertia and inductance of the coils is sufficient to smooth out the mechanical impulses of each pulse. This minimum would differ from motor to motor. Too low a frequency, and the motor motion will be perceived as a series of jerks, or a rattle. 
The frequency needs to be not so high that the switching device (MOSFET, other) and connecting wiring do not waste significant power in switching losses. Too high a frequency, and the efficiency will drop. This maximum would differ depending on the switching mechanism, the length of wires to the motor, the drive voltage (higher voltage = slew-rate limitations), shielding, perhaps some other factors too.
The frequency should, if possible, avoid the audio spectrum: below 20 Hz (not a good idea except for really massive motors) or above 20 KHz, so that the magnetostrictive vibration in windings or sympathetic vibration in the mechanical rotor, will not be heard by humans.
In addition to all of this, a specific motor + load + mounting combination will have a resonant frequency at a given temperature. While this is likely to be not as high as the 20 KHz+ applied for typical motor PWM, certain types of rigid mounting can indeed reach ultrasonic resonant frequencies. If the PWM frequency matches the resonant frequency, resonant oscillations can cause the motor to vibrate uncontrollably. This is why rubber / nylon / elastomer buffers are commonly applied for motor mountings. 


This last issue is somewhat self-curing though, since after a bit of resonant oscillation the mounting tends to give / wear, even if it is rigid metallic mounting, and this changes the resonant frequency.