Target Display mode only works with other compatible sources (Macs), here is some info.
https://support.apple.com/en-us/HT204592
FYI - The older 2009-2010 27" iMacs that have mini DisplayPort, which pre-dates the current Thunderbolt port, did have an external hardware option to convert HDMI sources to the iMac input, the Kanex XD: http://www.kanex.com/xd
But you can only send 720p over the Kanex XD from the HDMI source to the iMac, not the full 1440 or 1080.
I got one of those but never did get it to work with a Win7 PC laptop HDMI source on my 2010 27" iMac. I did not try it with my XBOX360 or WiiU.