In the end, there was only one lane to victory in Iowa, and Donald Trump had it all to himself.

The candidates challenging the former president had hoped to find enough dissatisfaction with him to build their own voter coalitions. Nikki Haley, the former South Carolina governor, had shown signs in polling of consolidating college-educated Republicans, such as those in the suburbs or college towns of Iowa, as well as voters less committed to conservative causes.

Ron DeSantis, the Florida governor, had moved aggressively to win voters who fear a liberal takeover of schools, businesses and academia.

But Trump carried those groups, winning some handily, according to preliminary results from AP VoteCast, a survey of people who said they would participate in the caucuses. He won 32% of college graduates to Haley’s 30%, while dominating among those without a four-year college degree. He beat Haley 45% to 33% among self-identified moderates. And he won the largest share of voters who said they lived in urban or suburban communities.

While caucus participants showed high concern about school curricula, saying kindergarten through eighth-grade classrooms were too focused on teaching about racism, sexual orientation and gender identity, Trump won substantial majorities among all those voters, leaving DeSantis with little support.

Trump’s opponents might have better prospects in New Hampshire, the next state on the GOP’s nominating calendar. Independent voters are plentiful in the state, and they can vote in the Jan. 23 primary.

And with vote counting still under way, it was unclear whether Trump had won more than 50% of the vote in Iowa. That left open the prospect that, later in the nominating process, a single challenger could consolidate voters ready to move on from the president—a proposition that would require other candidates to drop out of the contest.

But there were few signs from Iowa of traction among voter groups that Haley or DeSantis could build on in later-voting states. In nearly complete vote totals, Trump was winning the state’s suburban and university-heavy counties, where he had placed third in 2016.

Had Haley or DeSantis won those counties—around Des Moines, Iowa State University and the University of Iowa—it would have been a sign of potential support among suburban and college-educated voters in later-voting states where they make up a larger share of the voter pool.

Moreover, Haley and DeSantis voters in Iowa were different enough to suggest that neither one could win meaningfully large shares of the other’s supporters.

About 40% of DeSantis supporters, for example, said they supported the Make America Great Again movement, Trump’s set of ideas and policies, suggesting that Trump would be their second-choice candidate. About 40% of Haley voters said they would be so dissatisfied with DeSantis as the nominee that they wouldn’t back him in a general election.

Preliminary results from the VoteCast survey found at least one potential weakness in Trump’s standing as a general election candidate: Some 20% of caucus participants said they would be so dissatisfied if he were the nominee that they wouldn’t vote for him in November—a possibly dangerous sign of erosion in Republican unity.

Of that group, 64% backed Haley in the caucuses—showing that while she had largely consolidated Republicans who can’t accept Trump, the group was far too small to make for a meaningful political base.

Haley supporters, by wide margins over other GOP contenders, also believed the former president had acted illegally in interfering in the 2020 presidential election vote counting, as well as when it came to the Jan. 6, 2021, attack on the U.S. Capitol—both unpopular positions among the wider caucus voter pool.

Overwhelmingly, the Iowa caucus-goers, in answering the survey, showed how significantly Trump has shaped the Republican Party.

Some 40% said in preliminary results that the top issue facing the country was immigration—an issue that as much as any defines Trump’s policy agenda. That result marked a rare departure from voters telling pollsters that the economy is the nation’s most pressing issue. It ranked second, at 34%.

Moreover, Iowans in the caucuses had a sharply negative view of immigration, with about three-quarters saying immigrants in the U.S. today do more to hurt the country than to help. And 88% favored building a wall along the U.S.-Mexico border—Trump’s signature policy issue—including more than 70% who strongly favored the idea.

Some 62% said they support the Make America Great Again movement, Trump’s set of ideas and policies. The same share said President Biden wasn’t legitimately elected to the White House, another example of GOP voters aligning with Trump’s views.

Haley won pluralities among voters who had done college work beyond a bachelor’s degree, as well as college graduates who live in suburbs—two groups that account for small shares of the overall GOP primary electorate.

VoteCast, conducted by the Associated Press-NORC Center for Public Affairs Research, surveyed 1,597 voters in the days before the caucuses, concluding as the caucuses began. The margin of error was estimated to be plus or minus 3.4 percentage points.

—Dante Chinni contributed to this article.

Write to Aaron Zitner at aaron.zitner@wsj.com and Jack Gillum at jack.gillum@wsj.com