Generally speaking, if Reuven tells Shimon to violate a mitzvah on pain of death, Shimon may - possibly must - violate it.
Let’s say that Reuven comes to Shimon and says that if he doesn’t violate a mitzvah he will kill Shimon’s wife and children. Is Shimon obligated to violate the mitzvah in order to save his family’s life? May he violate it in order to save his family? Does it matter which mitzvah it is?
Let’s assume that he can’t just kill Reuven to save his family, or call the cops, or any other trickery. If he doesn’t violate this mitzvah, his family is dead.