Less ethnicities than cultures and metaphors. Darmok notwithstanding.
The Klingons were originally intended to look Asiatic and resemble Mongols or Japanese samurai, with the Klingon Empire being essentially the Soviet Union In Space. And there is an uncomfortable elephant in the room that Klingons, a species mostly known for violence and bloodlust, are all (or almost all) black coded. While the implications are obviously unintentional, it's impossible not to draw parallels in the history in sci-fi and fantasy to the "swarthy, dark-skinned savage" archetype.
Speaking of which here[0] is a video on Klingons and the history of racial coding in Star Trek if anyone is interested.
The relationship between Cardassians and Bajorans is clearly a metaphor for post-war Germany, with the former being Nazis and the latter Jews. Romulans, obviously, are Space Romans.
The Borg clearly represent the dehumanizing effect of technology and collectivism, making them a perfect foil for the Federation with its techno-utopian ideals. I've heard but can't prove that the Borg were meant to be a parody of Japanese business culture. There are alien stand ins for racial prejudice from "Let That Be your Last Battlefield" and nonbinary gender persecution from "The Outcast," and the Trill species in general. In cases like these, the aliens are meant to serve as a mirror to some aspect of humanity.
And of course the Ferengi have already been discusssed here.
Although in one egregious case (TNG's "Code of Honor")[1] the "aliens" were literally just African caricatures in space. And of course TOS gives us planets with literal space Nazis, space Romans, space Cowboys, space Greek Gods, space whatever costumes they could scrounge from the Desilu lot that week.