Would it work if I swap the hard drive between two Macbook Pro?

This will work with the right toolkit (see links below) since the system software (Mac OS X) is almost hardware-agnostic, especially if you use a newer system than the original one. Actually some of the different MacBook Pro Mid 2010 models were sold with the same hard disks (the 500 GB serial ATA). The only thing you may have to adjust is the screen resolution.

Hard Disk Replacement/Swap:
MacBook Pro 15" Mid 2010 MacBookPro6,2
MacBook Pro 17" Mid 2010 MacBookPro6,1

But why don't you just use a Firewire 800 cable, start the MacBook Pro 15" in Firewire Target disk mode and connect it to the MacBook Pro 17"?

You may even start your MacBook Pro 17" from the Target mode MacBook Pro 15" by choosing the latter in System Preferences -> Startvolume.

Update: Hard Disk Replacement/Swap: MacBook Pro 15" Early 2011 MacBookPro8,2

The standard of the Serial ATA interface changed from 2.0 (MacBookPro6,1) to 3.0 (MacBookPro8,2). If the MacBookPro8,2 contains a SATA II hard drive it will work, if it contains a SATA III hard drive it should work (depends on the hd).