The 2014 and 2015 models are definitely prone to image retention, but I've seen fewer complaints regarding the 2017 and 2019 models.
Important to make this distinction here; image retention is temporary (ghost image fades away and is gone after a few minutes), while burn in is a permanent ghost image and is not at all common on iMacs.