Steven Tong, holding a Donald J. Trump sign, and Anthony McBride behind him, wearing a “BE YRSLF” T-shirt, in the San Jose Convention Center parking garage. Patrick Tehan/Bay Area News Group

It was a fleeting confrontation between two strangers that might have otherwise been forgotten.

But the tussle over a Donald J. Trump campaign sign after a June rally in San Jose, Calif., has already sent one man, Anthony McBride, to jail for six days, and left another, Steven Tong, lamenting the loss of civility in our democracy.

The rally where these two lives collided by happenstance erupted into one of the most violent episodes of this contentious presidential election. Video footage of protesters punching, egging and tackling Trump supporters went viral, sparking outrage among Republicans and soul-searching among Democrats.

Today, the clashes between ordinary people like Mr. McBride and Mr. Tong are playing out in the California courts, in a series of criminal prosecutions brought about as Republican officials accused a city led by Democrats of failing to protect Trump supporters at the rally.

The San Jose rally and its aftermath may be the most powerful illustrations of the dangerous polarization that has gripped the country during the 2016 election.

But a closer look at Mr. Tong, one of rally’s 24 victims, and Mr. McBride, one of 22 people charged with crimes after the event, suggests that there is much that the two men share. The economic struggles and personal dreams that guided them that day are not so different, after all.

Trump supporters waiting to meet the Republican presidential candidate after he spoke on June 2 in San Jose. Damon Winter/The New York Times

On June 2, Mr. Tong woke up in his parents’ house, where he has lived for the past three years, ever since he found himself unable to afford a place of his own.

He is 46, an age he does not like saying out loud because it reminds him how far he is from where he had hoped to be. He had dreamed of becoming a product designer and starting his own company. But art school was too expensive and he left after only a year.

“Companies like Facebook and these so-called social networking companies here in Silicon Valley became the economy,” he said.

“If your occupation is in anything other than that,” he added, “there are not a whole lot of jobs.”

Police officers formed a line to contain protesters outside the rally in San Jose. Noah Berger/Associated Press

Mr. Tong’s faith in the American Dream has been shaken. But that day, he had a ticket to see Mr. Trump speak about making America great again. Despite the sweltering heat, Mr. Tong parked in the garage at the San Jose Convention Center and walked a few blocks to the rally.

That same morning, Anthony McBride, who is anti-Trump, woke up in his friend’s mother’s apartment, where he has lived for the past three years, ever since he found himself unable to afford a place of his own.

He is 21, too young to carry the stain of life’s disappointments. He dreams of being a fashion designer and starting his own company. But art school is too expensive. He works two jobs — at a car dealership and a clothing store — to save for it.

He also designs shirts that read “BE YRSLF.”

He hopes they will inspire “a movement where people are just being themselves and are not following trends or what society says they have to be,” he said.

Mr. McBride’s faith in the American Dream remains intact, but it is marred by the bigotry that he sees as a product of Mr. Trump’s campaign. On the morning of the rally, Mr. McBride put on a “BE YRSLF” T-shirt and boarded the light rail to the convention center, eager to see for himself what a Trump event was really like.

Steven Tong

“It was hot that day,” Mr. Tong recalled. “I was still debating whether or not I wanted to go, and I just kind of thought, ‘Oh, I got to show my support.’”

In the convention hall, Mr. Tong delighted in the diverse makeup of the crowd.

“I was really surprised,” he said. A rally he had attended earlier in the spring in Southern California, he said, “was mostly Caucasian and middle-aged.” But in San Jose, a city that is about 30 percent Asian and 30 percent Hispanic, more minorities turned out.

Outside the hall, beyond the police barricades, protesters waved signs demanding socialism. Young men handed out the Revolutionary Communist Party’s newspaper.

Like many Asians in San Jose, Mr. Tong was born in Vietnam. He was 4 when Communists captured Saigon.

His family had three strikes against it: His father had worked with the United States military. His grandfather had an import-export business. And they hailed from China, a country that once colonized Vietnam. Officials forced Mr. Tong’s family to move to a remote hut with a dirt floor.

“The Communist philosophy was, ‘If you are a teacher, a professor, an intellectual, wealthy, then we are going to make you suffer,’” Mr. Tong said.

When he was 9, his family made it to California. Like others who had fled Vietnam, they embraced the Republican Party’s strong anticommunism stance.

Mr. Tong considers himself a moderate. During the booming 1990s, he once cast a ballot for Bill Clinton. He says he does not agree with Mr. Trump’s remarks about immigrants and Mexicans.

Still, Mr. Tong feels anxious about the racial unrest flaring up across the country. Like many Trump supporters, he blames President Obama.

“He seems more polarizing,” Mr. Tong said of Mr. Obama. “He stirs people up.”

Mr. Tong once felt boundless optimism about the United States. His parents, who worked entry-level jobs in electronics, had been able to buy a three-bedroom home in a well-off San Jose suburb. But now Mr. Tong cannot afford to rent — let alone buy — a home of his own. He was drawn to the June rally by Mr. Trump’s promise to make America as strong as it was when Mr. Tong arrived in the country.

Mr. Trump took the stage and declared, “We have a country that’s not working anymore.”

“We have a chance to be greater than ever before,” he told the crowd.

Mr. Tong left the rally clutching a sign: “The silent majority stands with Trump.”

He meandered back to his car, chatting with a teenager from Mexico who held a sign opposing Trump. They joked about trading signs. Nothing seemed threatening or out of the ordinary. But when Mr. Tong reached the parking garage, he witnessed something shocking: protesters trying to steal Trump hats off the heads of an older Hispanic couple.

He added: “At that moment, I felt the whole crowd surrounding me. You’re fearing for your life.”

Mr. Tong ran into the garage. He noticed a tall black man coming behind him.

Anthony McBride

It was Mr. McBride’s day off, he recalled. “I slept in, watched some TV,” he said.

While checking Twitter, he noticed that Mr. Trump was coming to town.

Mr. McBride hoped to get into the rally “to go experience what he says for myself,” he said. But a wall of police officers blocked the entrance. So he drifted to the “free speech” area, where protesters — including some friends from Oak Grove, where he had gone to high school — gathered. Mr. McBride had fond memories of Oak Grove, even though he was asked to leave it.

Mr. McBride was in jail for six days, accused of vandalism, battery and the attempted theft of Mr. Tong’s sign. Jim Wilson/The New York Times

In his senior year, he had attended a basketball game against a suburban school from a more affluent community. Rival fans chanted that Oak Grove students were on welfare. Mr. McBride said he and his friends responded with their own chant, “We drive sober” — a painful reference to a drunken-driving death the rival school had recently suffered. Afterward, Mr. McBride said, school authorities asked him to finish his credits with independent study. (The school’s principal declined to comment.)

At the time, Mr. McBride lived with his aunt, who told him he had to be in school to stay with her. He ended up on the couch in the apartment of his best friend’s mother. Three years later, he is still there.

Mr. McBride considers himself a moderate. He opposes amnesty for undocumented immigrants. He believes that the entrepreneurial spirit should be rewarded.

But it is racism — not government regulation of the economy — that worries him. The son of an African-American father and an Irish mother he has not seen since he was 4, Mr. McBride blames the recent racial unrest on injustice, not Democratic politicians.

“People are just frustrated,” he said. “With police brutality. With feeling not equal to white people.”

To Mr. McBride’s generation, the spate of high-profile police killings of black people shows the limits of politics and the need for activism. Protests — not the election of a black president — have brought a modicum of justice.

Joining the gathering crowd outside the convention center, Mr. McBride felt he had justice on his side.

At first, he said, it felt like a carnival outside the arena. People danced to Mexican music. Street vendors sold watermelon.

But then the rally inside ended. Trump supporters poured out. Protesters chanted obscenities at them. They hurled insults back.

A blonde woman named Rachel Casey, who was wearing a Trump shirt, filmed herself sticking her middle finger up at the crowd. Protesters traded insults with her as she drifted past the police barricades to the Marriott Hotel next door. Protesters surrounded her in the doorway.

Then someone threw a piece of watermelon.

“I was in the front, just clapping,” Mr. McBride said. “Someone in the back started throwing eggs. One of them hit me. I was like, ‘Wow, who brought eggs?’”

A hotel security guard opened the door and Ms. Casey slipped inside. The crowd marched on. A black female protester burning an American flag got into a shoving match with a white female Trump supporter. A white teenager got scared and started running. A black teenager tackled him. A first-generation Mexican who opposes Mr. Trump punched in the nose a third-generation Mexican who supports the candidate.

Protesters surrounded a woman named Rachel Casey, who was wearing a Trump shirt, outside the Marriott Hotel in San Jose, Calif. This video contains profanity. By NBCUniversal Archives on June 2, 2016. Photo by Josh Edelson/Agence France-Presse — Getty Images.

The police later traced the most violent run-ins to “local gangsters” with long criminal records, according to Sgt. Brian Anderson, who headed the San Jose police team that pored over thousands of hours of videos from the rally.

Some Oak Grove High School students were also charged. “Several of them were good students and athletes, but they decided to forget their upbringing,” Sergeant Anderson said.

Mr. McBride might have fit into in that category. He was an athlete, but he said his father, who works at a warehouse, allowed him to play sports only if he got good grades.

But Mr. McBride admits that he got angry that day at the rally. He says Trump supporters mistook him for Mexican and shouted insults at him.

“I heard, ‘Go back to your country, wetback,’” he said. He started taking every Trump sign he saw and ripping it in half.

He followed a wave of protesters into a parking garage. That’s where he spotted an Asian man with a Trump sign.

“I was kind of disappointed in him,” Mr. McBride recalled. “He’s a minority, and I didn’t see why he’s supporting Trump.”

Mr. McBride snatched Mr. Tong’s sign. Mr. Tong grabbed it back. For a split second, they held it together, in a tug of war. Mr. McBride could see the fear in Mr. Tong’s eyes.

Months later, Mr. Tong looked back at the encounter and wondered about Mr. McBride. Was he a college student?

“He didn’t seem like a gangster,” Mr. Tong recalled. “There are protesters who are just upset, and I think if I was in their position, I’d be upset, too. But no protester — no matter how angry they are — can break things and harass people.”

Maybe because of the stress of what happened to him at the rally, Mr. Tong dreams of escaping on Election Day. He thinks about camping in Death Valley on Nov. 8 just so he can get away from the news. But sometimes he has the opposite desire. He wants to visit an old friend — a black man he met in a long-ago photography class — so they can have political debates about Mr. Obama that he keeps bottled up inside.

Meanwhile, Mr. McBride thinks back on that moment and regrets being the source of Mr. Tong’s fear.

“I’d probably have been afraid, too,” Mr. McBride said. “I didn’t agree with any of the fighting.”

But two weeks after the rally, police officers showed up at Mr. McBride’s job at the mall and asked him to answer some questions. Mr. McBride, who has no criminal record, cooperated. He did not ask for a lawyer. “I wasn’t scared because I didn’t do anything,” he said.

He said he told them everything he could remember. Afterward, he expected to be allowed to go home. Instead, they handcuffed him and took him to jail, where he remained for six days, accused of vandalism, battery and the attempted theft of Mr. Tong’s sign.

On a recent Wednesday, Mr. McBride sat in court on a row of benches filled with black and Hispanic men, nearly all of them represented by a single public defender.

“McBride? You’re our Trump guy, right?” she asked.

She explained that because of what he had told the police about the confrontation outside the rally, prosecutors were adding a new charge: the false imprisonment of Ms. Casey, who had been egged.

“We’ll try to get it down to ‘disturbing the peace,’” she said. “I don’t know if we’re going to get there, but that’s our goal.”

Now Mr. McBride, who cannot afford a lawyer, is not sure if he should plead guilty to a crime he doesn’t feel he committed, or fight the charges. He thinks about that moment when he grabbed Mr. Tong’s sign, and about what made him let it go.