VFDs really don't care what the motor speeds are. They simply put out a frequency. At 60hz (or 50hz, for our European friends) they will simply run the nameplate RPMs. The only real concern with RPMs and VFDs is on the two extremes of the dial. If you run slow for long periods of time, your motor can overheat since the fan is designed to cool at the motor's nameplate RPM. Too slow, and you're really not getting optimum air flow.
On the high end, I suppose you could prematurely wear out your motor bearings (or other parts of the machine that the motor is running) if they weren't designed for much higher RPMs. Heat could ultimately be a problem on this end as well.
As for running different sized motors, you can run a smaller motor on a larger VFD, but not the other way around. Depending on the VFD, you can often change jumpers or parameters to match the smaller motor if you like, though if you're swapping between machines a lot, most people won't bother, since it's a pain. You're really only sacrificing the VFD's built in protection for the motor, which under MOST normal operating conditions, shouldn't be a huge factor, especially if within, say, 1/2 a HP or so. For basic things like running a grinder or a drill/mill, you should be fine. Just be mindful if you're snagging a lot of bits, or taking really heavy cuts for long periods of time, as you could potentially overheat the motor, and it may not produce an overcurrent fault as soon as would typically be ideal.
In short, just keep an eye on the motor temps (especially a smaller motor on a larger VFD) and you should be ok. Just my $.02, YMMV.
All that said, YES, it generally IS best practice to match motor and vfd nameplates (or at VFD settings), but running a 2hp motor with a 3hp VFD won't automatically cause chaos and destruction.