Apparently, it can be done. Not that I would ever try it.If the iMac has a video line in, ( analog or digital) then technically, there should be some way to do it, but I think that it's going to require more than just a KVM setup.
Since the monitor and "tower" are one unit, it would be difficult to split 2 signals to it.
that link doesn't specify what kind of Mac the user has. My guess it is not an iMac... i don't believe they have any Video-in ports on them.