The party scored an early upset with just such a candidate, Conor Lamb, in a Pennsylvania special election in March. Mr. Lamb, a veteran, opposed Ms. Pelosi, single-payer health care and most new gun regulations, but with a populist economic message captured a district Mr. Trump carried easily in 2016.

Democratic voters have largely been going along in the primaries held so far in these districts, which are often in rural areas. In Illinois the voters chose Brendan Kelly, a prosecutor with a mend-it, don’t-end-it message on the Affordable Care Act, to take on a conservative Republican in a rural district. And on Tuesday, Democrats in several states that President Trump carried in 2016 selected ideological mavericks to carry their banner in difficult House races.

One was in Indiana, where Mel Hall, a businessman and former minister who has made political donations to Republicans, dispatched rivals on the left who called him an unreliable Democrat.

Another was in West Virginia, where Richard Ojeda, a fiery populist running for an open seat in the southern part of the state, has boasted of having voted for Mr. Trump in 2016.

Representative Josh Gottheimer of New Jersey, a first-term Democrat who wrested his closely divided district from a hard-line Republican in 2016, said his party should strongly back moderate candidates who have the potential to compete in areas that often prove politically grim for Democrats. Mr. Gottheimer, who is backed by the conservative-leaning U.S. Chamber of Commerce, urged liberal Democrats to accept some ideological dissension in the party’s ranks in order to achieve a congressional majority.

“If we’re going to win some of the places we can win, in redder parts of the country, it’s with people who may not be aligned on certain issues with some other Democrats,” Mr. Gottheimer said.