TOKYO—A contentious accusation underpins a trade dispute between Japan and South Korea: Chemicals and equipment bought by South Korean companies from Japan may be helping North Korea build weapons of mass destruction.

The charge by Japan, which South Korea denies, has widened a diplomatic rift between the two U.S. allies, which are clashing over legacies of Japan’s 35-year colonization of the Korean Peninsula through 1945.

On...