Short Answer: You’re better off just buying cheap MacBook Pro RAM than interchanging RAM upgrades.
The answer to the question on whether you can swap out the RAM from an Apple iMac to an Apple MacBook Pro depends on what specific Apple iMac and what specific Apple MacBook Pro you want to change or switch the memory from as all MacBook Pro ram upgrades are not the same as all iMac memory upgrades, so you need to be very specific what exact Apple model you wish to perform this task with, as the answer to this could depend:Yes or No.
I guess my first question is considering the cheap price of Apple Memory these days and that for both the Apple iMac and the MacBook Pro RAM is so cheap, why don’t you just buy more Macbook Pro memory and be done with it. As I see it, you want to remove RAM from Apple iMac and Install RAM on MacBook Pro but my question is why?
This will leave you with an Apple iMac with too little RAM, or at very least not enough ram or less RAM than you had before in the iMac and more RAM in the MacBo0k Pro. I don’t recommend this and really except for a few rare instances (16GB for MBP) and bigger ram upgrades for Mac Pro – all Apple memory upgrades should for the most part ship for under $100 for 8GB of RAM which not the maximum RAM on either machines, sounds to me like a better idea than what you’ve got planned.
But yes (again, I don’t recommend this. Do so at your own risk..etc) if you want to or need to swap RAM from an iMac to MacBook Pro you can, but you have to pay attention to the speed of memory in both machines. In the case of the latest iMacs which were announced summer 2010 and the MacBook Pros just announced last month, these two do accept DDR3 SDRAM sodimms that could (have I mentioned I don’t recommend this?) be swapped from an iMac to a MacBook Pro.
You’re much better off buying new RAM for the MacBook Pro and leaving the RAM inside the Apple iMac