The Empire in Star Wars is based on a few things, Nazis, the British Empire, and even post-war American politics (Nixon and America in Vietnam, according to George Lucas himself). It's usually marked by a fanatical obsession with order which does differ from the modern American far-right, which likes to at least frame itself differently as being about "liberty" in some way.
The Ferengi represent contemporary American society at the time (which still persists; Ferengi would definitely elect a person like Donald Trump as Grand Nagus, assuming that's a democratic position). Consider that TNG started in 87, in the decade of Gordon Gekko. It seems pretty clear to me when I watch that era of Trek, and I'm amazed people got hung up on this other thing.
The Federation is maybe what the viewers of the time liked to see ourselves as, but the Ferengi are the reality.
The US far right is weirdly anarchistic sometimes, I think the best description is in A Time To Kill when one of the white racists talks about "skinheads who want to blow up the government".
The left wing used to be like that, you had a bizarre anarchistic methodology with the ultimate aim of a totalitarian authoritarian order, ie stalinism.
That pattern has been one of the things that started me thinking along the lines of just how many of those trends are engineered, flags of convenience, fronts for crime or spooks agendas, unstable people or people with personality disorders just being channelled this way or that. Nothing new about that though, The Man Who Was Last Thursday or The Secret Agent deal with themes like that away back when the menace was the "mad anarchist bomber" type thing.
With regard to Trek, I never really thought of it as meaning anything other than sci fi, definitely in the case of TNG, rewatching the original series much later in life some of the episodes are mad cold war propaganda. Although A LOT of UK and US TV I recall growing up felt like the country was still fighting the second world war, especially in the UK at least, not in a "glory days" type nostalgia but literally as though it was still going on.
I first realized how political some of TNG may be when I heard it criticised on US far right and free marketeer websites as being commie propaganda or space commies, I'd never thought of it that way, those guys definitely identified as Ferengi but they criticised the first contact with the Ferengi in TNG as they attacked the Federation unprovoked which, you know, was supposedly not how free traders do buisness, plus free traders would never automatically think about enslaving strangers as the Ferengi did then.
Bizarrely, or maybe not so bizarrely as I dont know what you're opinion of it will be, but I've heard more recent punditry attacking the Ferengi as anti-semitic and suggesting that the big ears feature of that alien race is actually a reference to interwar anti-semitic cartoons of jews as possessing big noses etc. which is a bit of a sumersault if you ask me, I also dont know why the whole "jews as uber capitalists" is still a thing, or why Jewish sources would want to "own" that idea. Anyway.
Also what about V? That show was initially meant to be just about an invasion of communists, they went for the space and lizard angle when they decided that they couldnt sell it or it wouldnt be popular enough as a straightforward communist invasion idea. Which I think is crazy as a ton of the conspiracy theories of today about illuminati owl worshipping lizards seem to be derivative of that show.