HAPPY VALLEY, Ore.—As voters in this state prepare to decide whether to legalize recreational marijuana, a dispute over taxing the drug is demonstrating the complexity of transforming a black market into a legal one.

Drafters of the Oregon initiative, Measure 91, have proposed a state tax on pot producers that would be lower than those in the first two states where recreational pot was legalized, Colorado and Washington. Their aim is to prevent a situation where high prices at authorized pot shops push buyers to the black market.

But ahead of November’s election, dozens of Oregon cities eager for a piece of the pot-revenue pie, including this quiet suburb outside Portland, have passed plans for their own local taxes on pot sales, setting up a possible legal battle if the measure passes.

The squabble underscores how little is known about the appropriate way to tax legal marijuana, experts say.

“If the tax is too large, then you’ll still have the black market,” said Beau Kilmer, co-director of the RAND Drug Policy Research Center. “If you have low taxes, you may not get as much revenue as you want.”