Comedic actor Tim Allen joked briefly on “Jimmy Kimmel Live!” Thursday night about having to keep quiet about his conservative views in Hollywood.

Mr. Allen mentioned that he attended President Trump’s inauguration and then immediately tried to justify his attendance by saying he went to see Democrats and Republicans.

“I’m not attacking you!” Mr. Kimmel assured the comedian.

“In this town?” Mr. Allen responded. “I’m not kidding. You gotta be real careful around here. You get beat up if you don’t believe what everybody believes.

“This is like ‘30s Germany,” he said. “I don’t know what happened. If you’re not part of the group, ‘You know what we believe is right,’ I go, ‘Well, I might have a problem with that.’

“I’m a comedian, I like going [off] on both sides,” he added.

Mr. Allen said one of the main issues that concerned him this election season is government surveillance and the online tracking of consumers by corporations like Google and Amazon.

“If the government drove down the street in a gray sedan with a camera on it, you’d be rioting, going to Washington,” he said. “But if it’s white, with emojis and ‘Google’ on it, ‘Yay! You’re waving at it! They’re taking pictures of your house!”

“Who are these people? I wanted to put FU on the top of my house,” he said.

The comedian, who calls himself a “fiscal conservative,” said Amazon also knows “way too much about us,” citing the website’s tracking of consumer habits.

Mr. Allen, who last January compared the Clintons to “herpes,” endorsed Republican Ohio Gov. John Kasich in the 2016 presidential election. Though he never openly endorsed President Trump, he spoke out in November against Hollywood liberals for “bullying” the people who support him.

“What I find odd in Hollywood is that they didn’t like Trump because he was a bully,” the “Last Man Standing” told Fox News host Megyn Kelly at the time. “But if you had any kind of inkling that you were for Trump, you got bullied for doing that. And that’s where this — it gets a little hypocritical to me, is that you can now bully people.”