An iMac is OK for gaming IF the games you want to play are available for it. Lots of games that require DirectX never make the port. You can always install Windows via Boot Camp and use it to play PC games though.
Why is Mac Not suitable for gaming?
Answer: Macs are not good for gaming because they focus more on software optimization than on raw hardware power. Most Macs simply don't have the kind of hardware power required to run modern games, plus the selection of games available for macOS is very small compared to Windows.10 Jan 2022