If you buy the same model Macbook, then the old hard drive should work perfectly. If it is a different model, things can get tricky. The hard drive has startup files that assume the presence of certain hardware.
One thing that is easy to do, is to use the hard drive in target disk mode before you swap the hard drive. This allows you to mount the hard drive externally, but boot the Mac from it. If the new Mac starts with the old hard drive, then you can safely swap it. If not, then you can return the Macbook.
-Purchase a USB to SATA adapter (example)
-Attach the hard drive to the adapter, and then plug into USB
-Reboot the computer, and hold down the "T" key. A menu will show your external drive. Select it.
Of course, reusing the hard drive also means that you now have a used, three year old drive in your Mac. The data on the old drive is not tied to that drive, and its fairly simple to transfer it. Another option is to purchase an external case for the hard drive, in which case you simply attach the drive whenever you need the data.