Search for teardown videos. You can get into them, but it involves removing the display by breaking adhesive, so you must reapply adhesive to reassemble. In the case of the iMP, you can replace the RAM, (possibly the) CPU, and SSDs, though you must basically take the entire system apart to do so. In the case of the 21.5" iMac, you can only upgrade the storage as RAM and CPU are soldered. For the 27" iMac, the RAM is easily accessed from a rear hatch, while the CPU is socketed and the storage replaceable via complete teardown. So yes, it's possible depending on the model you chose--it's just not easy.
I believe any user-attempted upgrades would void the warranty, short of adding RAM to the 27" non-pro iMac.