For the blunt-spoken Mr. Trump, who likes to stress his desire to strengthen the military and improve how veterans are treated, the gathering provided a receptive audience, if one where he might otherwise seem out of place.

“He speaks what’s on his mind and means what he says,” said Tom Christian, 43, a heating and air-conditioning contractor from Tennessee. “And that’s what a biker does. That’s the way we are: We say what we think. If you like it, you like it. If you don’t, go the other way.”

The warm embrace from the crowd gave no hint of the controversy that Mr. Trump incited last year when he denigrated the military service of Senator John McCain of Arizona, a former prisoner of war in North Vietnam. Mr. Trump said Mr. McCain, a fellow Republican, was not a war hero, saying, “I like people that weren’t captured, O.K.?”

Mr. Trump is the latest political figure, but not the only one, to pay attention to bikers. Wearing a black Harley-Davidson helmet, Sarah Palin, the former governor of Alaska, appeared at Rolling Thunder in 2011, months before saying she would not run for president in 2012.

And one of Mr. Trump’s former Republican rivals, Gov. Scott Walker of Wisconsin, a proud Harley-Davidson owner, campaigned at Harley dealerships and wore motorcycle boots on the campaign trail. Asked during a debate what he wanted his Secret Service code name to be, he suggested Harley.