New Hampshire’s first-in-the-nation primary is emerging as a test ground for a debated legal theory that Donald J. Trump is ineligible to appear on the ballot under the 14th Amendment of the U.S. Constitution. A presidential candidate with low odds of winning has filed a lawsuit in state court seeking an injunction to exclude Mr. Trump from the ballot. A former Republican Senate candidate is also urging the secretary of state to bring a case that could potentially reach the U.S. Supreme Court. The theory argues that Mr. Trump’s actions on January 6, 2021, disqualify him from running for office under Section 3 of the 14th Amendment. It is gaining traction among liberals and anti-Trump conservatives, but even its advocates recognize that it faces an uphill battle legally. If a secretary of state removes Mr. Trump’s name or a voter lawsuit progresses, his campaign will likely appeal the decision, potentially leading to a Supreme Court case. This issue is being discussed in various states, with legal guidance being sought by secretaries of state. The debate over disqualification is particularly appealing to liberals, although most of the recent momentum comes from conservative circles. While the case against Mr. Trump’s eligibility is far from settled, it has generated interest and attention, and its outcome could have significant implications.