“People entered the 2018 election with pretty strong views of the president, one way or another,” said Bruce Mehlman, a Republican strategist and lobbyist who publishes a widely read political analysis. “The rallies didn’t change them. But the rallies allowed the president to make the election a referendum on him.”