The first major test of whether states can hold drugmakers accountable for the opioid crisis is headed to an Oklahoma courtroom.

In a trial starting Tuesday, lawyers for Oklahoma Attorney General Mike Hunter will argue that the marketing practices of Johnson & Johnson are to blame for widespread drug addiction that has devastated the state.

The...