... At least, without getting sued into the ground?
According to one of the answers to What was the most critical supporting software for COBOL on IBM mainframes?
We installed a new HP replacing an IBM system, and part of the installation was a emulator to run IBM code on the HP.
I haven't been able to find any likely reference to that emulator on Google. Closest thing I could find was an emulator called Hercules, which was first released in 1999. However, apparently IBM explicitly refused to license any of its operating systems for running on Hercules. Hobbyists might try it anyway with a pirate copy of an operating system just to play around, figuring probably rightly that IBM won't care, but a business would find it highly inadvisable to go that route.
And indeed, a comment to another answer:
It goes without saying that the mainframe middleware is heavily encumbered and protected by NDAs etc. No matter how supportive IBM might appear to be of cut-down versions of e.g. their MQ products running on unix or Windows, you can bet your life that anybody who tried to emulate every mainframe nuance would find themselves tied up in court for a long time.
That sounds plausible. Yet if IBM would react like that to someone emulating their middleware, surely they would react even more aggressively to emulation of the entire platform?
So what was the emulator on the HP referring to, and how did they get away with it?