A non-Jew may violate one of the Commandments if he is forced to do
so. Even if he was forced to worship idols, he may do so, since
non-Jews are not commanded to Sanctify the Name.
The Rambam follows the view that yehareg ve-al ya'avor (the obligation for a Jew to let himself be killed rather than transgress the laws of idolatry, murder of forbidden relations) is based upon the commandment to sanctify the name of God (and not the inherent nature of these commandments) and that a non-Jew doesn't have this obligation to sanctify the name of God. See more on that discussion in the gemara in Sanhedrin 74b.