@Laks Gandikota - The issue is which interface you are planning on using. If you are trying to use the PCIe blade SSD connector to put an M.2 Samsung 850 SSD it won't work as your system can't take M.2 SSD's. If you are thinking of replacing your SATA HD for a SSD then the SATA Samsung 850 SSD will work. If you still want to use the PCIe slot you'll need to get a real Apple SSD which is quite expensive! Or you can go with OWC's blade SSD option OWC SSD Flash Storage Upgrades iMac 27" 2012
But! Before you do this lets look at the drives throughput which is what most people are looking at (faster). The SATA III HD interface this system offers is 6.0 Gb/s (75 MB) the PCIe (2 lane) blade drive interface offers 5GT/s (500 MB). Now lets look at Thunderbolt 2 It offers 20Gb/s (2 GB/s) which is still faster! Remember this is the theoretical throughput must drives (HD's & SSD's) discretely can't push or receive the data at this rate. Only RAID'ed drive sets (SSD's) can get dam close with todays technology.
So what makes sense here? Leave your internal drives alone and go with an external RAID drive set it will offer the best bang for the dollar here. This is what we are using: ThunderBay 4 mini which offers a sustained 1.35 TB of throughput!
Here's a good writeup: Theoretical vs. Actual Bandwidth: PCI Express and Thunderbolt
Now here's the last shoe to fall ...
This series are a bear to open! You need to be very careful pulling off the display assembly if not you can damage it which would be an expensive mistake. Second getting to the blade SSD slot requires pulling the entire logic board out. Here are the IFIXIT guides:
In addition, if you swap out the HD you'll need a replacement thermal sensor: OWC In-line Digital Thermal Sensor for Hard Drive Upgrade for 27" iMacs 2012 and Later and you'll need an adapter frame like this one: OWC 2.5" to 3.5" Drive Adapter Bracket.