I have run my 2017 i7 iMac like that several days straight when transcoding video. I have done this frequently over the past six months. It is running fine today and has never had a problem.
The noise can be irritating to some people, so I understand how a 2017 i5 iMac might provide sufficient performance but much quieter high CPU operation. However I personally don't think there is a major durability risk for sustained high CPU workloads on the 2017 i7 iMac.
That said there have been a few reports of abnormally high temps on i7 iMacs, 2017 and before. The 2014 i7 iMac had some known issues in this area but even newer ones can have one-off issues, maybe from poor thermal paste application.
The iMac Pro is much quieter, somewhat faster, and the base model isn't hugely more expensive than a top-spec iMac. You can even configure an iMac so it costs *more* than the base iMac Pro.