Hi there, from my experience per se, you can connect the dead iMac to a functional Mac computer and launch Target Disk Mode on the problematic one, then access files and folders on it by using it as an external hard drive.
If you take the laptop to an Apple Authorized Service Provider, they may be able to try to recover data from the SSD if the laptop can be put into DFU mode and a specific service provider tool is used. I guess that an Apple Store might do this.
Otherwise, you can take the laptop to an Apple Store or an AASP and request that the data be recovered. They should be able to submit the Logic Board to a data recovery company like Drive Savers or Ontrack.
This is the only option if the laptop cannot even work with DFU mode or if neither the Apple Store nor AASP will attempt pulling data from the Logic Board's SSD.
Read for more information:
How to recover data from a crashed/dead MacBook Pro/Air?
Recover data from Mac, MacBook, or iMac that won't boot