Nope, it won't work; or even if it does, it may cause stability or performance issues. Definitely not recommended. The RAM in the 2012 MacBook Pro is 1600MHz as it has a 3rd gen Intel CPU. You need 1333MHz (PC3-10600) as your iMac has a 2nd gen Intel CPU.
Your iMac can support a maximum of 32GB RAM (4x8GB DDR3 1333MHz SODIMM). As long as it's 1333, it'll be fine.
This is frequently a point of contention here, but I can only go on what I've experienced. I've seen mixed and matched speeds on a 2011 iMac that have had strange performance issues or the system paging rather than using all the RAM. Replace with all 1333 and it works fine. Other 2011 MacBooks have had issues kernel panicking when running 1600MHz but run absolutely fine on 1333. And the RAM wasn't bad.
I understand that they might underclock. But honestly there are too many horror stories about 1600MHz RAM causing weird issues on 2011 Macs to simply dismiss. 1333MHz and 1600MHz SODIMM are also different voltages (1.5V vs 1.35V). Furthermore, Intel note that the supported speeds on those CPUs are 1066MHz and 1333MHz only. For these reasons, I can't confidently recommend 1600MHz.
However it is a large point of contention here, so I won't hammer the point. I guess the best advice to the OP is that if they encounter odd performance/stability after fitting, take them out and replace with 1333.
My personal and professional experience is different than that of yours in that it works without a problem. So much that for a time my work exclusively ordered 1600Mhz to upgrade both 2011 and 2012 machines.