You are limited to the CPU’s Apple has used in their systems. The Systems EFI (BIOS) limits you as well as the TDP of the chip.
So here is the 2017 iMac models: iMac18,3
The best CPU Apple offered is a i7-7700K which has a TDP of 91W and uses a FCLGA1151 socket.
The two CPU’s you were looking at here:
Both have a TDP of 95W and also uses a FCLGA1151 socket. Again, Apple’s EFI won’t support either and the TDP is a bit high from what Apple has used.
If we look at one of the Xeon W-2145 CPU’s the iMac Pro uses we can see the TDP is 140W so I’m suspecting the newer cooling system and power supplies is a requirement for these higher TDP CPU’s in this frame.
My guess is Apple will be intro’ing newer systems in the fall which might include newer iMac’s which are using the more powerful CPU’s and I bet you they will likely use the newer cooling design the iMac Pro. We’ll need to wait and see.