Console + iMac 27" 2011 External Display
Three things need to align for a game console to send video out and have it be mirrored on an iMac.

First, the iMac needs Target Display Mode.

The 2011 iMac and later run thunderbolt - so you need a legitimate thunderbolt video connection for Target Display Mode to work.

The older iMacs had Mini DisplayPort video out and video in, so you would simply need to get an inexpensive adapter to change HDMI to miniDP (note - most adapters go the other way - take a MiniDP signal and split out HDMI - this would need to function in the other direction.)

I believe PS3 doesn't have native thunderbolt adapter or even a mini DP adapter, so you'd need additional hardware for Macs older than 2011 and I don't know of a box that takes HDMI and converts it into thunderbolt - so you might be out of luck on 2011 and newer iMacs.