Moving Drives Between Macs
In general, this is a very safe, OS X boots other hardware in general situation.

However, when new hardware is released - often a special build is made and until the next revision or two of software, you can't boot that hardware so you'd need to take a hard drive from the specialized machine to an older one instead of the other way around.

It's far safer to migrate from a Time Machine or target mode or from running OS using file sharing / network. That way each machine has the correct OS and can flag apps or system files for non-transfer when there is a known problem migrating them.