Perhaps there is something in your question that I do not understand. If you need to use Cisco real IOS then it is clear that dynamips / dyanagen is not real IOS. In that case it seems that you need to use real IOS and not dynamips / dyanagen and therefore there is not much issue about legality.
As far as I know dynamips / dyanagen are legal for what they are. But they are not real IOS.
Dynamips and Dynagen (a front-end for Dynamips) are a form of vmware for Cisco IOS. This software runs actual IOS images for several cisco platforms including the 7200 and 3600 series, until now Cisco itself hasn't accused it to be illegal, and i don't think that there should be a reason to do this.
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...