Under New York State law, "if a surviving friend or relative of the deceased" argues that an autopsy is against the decedent's religious beliefs, no such examination can be performed unless there's a "compelling public necessity."
What does that mean, exactly? In a nutshell, coroners and medical examiners throughout the Empire State do have the right to override religious objections to an autopsy — but only if a) the procedure is part of a criminal investigation, b) the victim's death is linked to a major public health crisis, or c) a court reviews a formal petition and decides that there's another "demonstrable need for an autopsy or dissection."
Louisiana, California, Maryland, Ohio, New Jersey and Rhode Island all have comparable regulations in place. Minnesota joined their ranks in 2015, after a medical examiner tried to operate on the bodies of an Ojibwe man and a Chippewa woman who'd died in separate car accidents. This deeply offended both Native American communities because corpse desecration violates the Midewiwin religion's traditional burial practices. (Orthodox Jews often express similar reservations about tampering with a person's body posthumously.)
In some states like Florida and New Hampshire, religious protests against specific autopsies are reviewed on a case-by-case basis. One rule that's consistently enforced across all 50 states is that families and friends of the deceased cannot block an autopsy on religious grounds if the authorities suspect foul play or have a strong reason to believe that a threat to the general populace — such as a dangerous disease — led to the person's death.