(covers information from several alternate timelines)
"Totalitarian fanatics bent on world conquest. The Borg of their day... no offense."
- - Tom Paris and Seven of Nine in 2374
The term Nazi was an abbreviation of the designation Nationalsozialist, used originally only for members and supporters of the Nationalsozialistische Deutsche Arbeiterpartei (abbreviation: NSDAP; English: National Socialist German Workers' Party or National Socialist Party), a totalitarian fascist party in the nation-state of Germany, on Earth, in the early part of the 20th century. The Nazi Party became a tool for governmental domination, known as the Third Reich, by dictator Adolf Hitler who enforced policies of racial superiority and German dominance through various means such as the Nazi security organization known as the SS.
Nazi Germany, part of the Axis Powers, was a feared symbol of power in the 1930s and 1940s, and were principal participants in the massive worldwide conflict which came to be known as World War II. They set a model for autocratic dictatorship, hatred and oppression that has rarely been matched in their thirst for conquest, brutality and intolerance towards their fellow man, as evidenced by their persecution and systematic extermination of whole populations they deemed inferior in their own society.
The Nazi philosophy was shrouded in symbols and rituals, such as the swastika and "heiling" and the distinct uniforms. The latter was a greeting, originally derived from what was assumed to be the formal greeting within the Roman Empire. The Nazi regime also created and distributed a wide variety of medals and awards, many of which (such as the Iron Cross) were fairly well known centuries after the defeat of the Nazis in 1945.
The Temporal Cold War
In an alternate timeline created by multiple temporal incursions by various factions in the Temporal Cold War, Nazi Germany launched a successful invasion on the United States. This timeline was initially created through the assassination of Vladimir Lenin in 1916, preventing Russia from turning to communism. Not considering Russia to be a threat, Hitler was able to concentrate his war efforts on the West. France and England were conquered before the American East Coast by 1944. However the advance was too hasty and that same year the Russians were preparing to retake Moscow and Africa to be liberated.
The Nazis were assisted by another Cold War faction, the Na'kuhl, who promised to provide advanced technology to the Nazis in exchange for goods and materials with which to construct a temporal conduit to return to the future. The Na'kuhl were eventually successful, and used the conduit to return to the 29th century, igniting the Cold War into an all-out conflict and resulting in the very alternate timeline to which the Na'kuhl had traveled in the first place. This timeline was later negated by Enterprise NX-01, having been transported from the year 2154 by temporal agent Daniels, which destroyed the conduit before the Na'kuhl had a chance to utilize it. (ENT: "Storm Front", "Storm Front, Part II")
The Guardian of Forever
In yet another alternate timeline, the Nazi Party succeeded in taking over the world when Doctor McCoy traveled through the sentient time portal known as the Guardian of Forever, from 2267 to the year 1930 on Earth, where he saved the life of a social worker named Edith Keeler. Keeler would go on to form a massive pacifist movement in America, delaying that country's entry into World War II. As peace negotiations went on, the Nazis completed their heavy water experiments, and with the atomic bomb, and the V2 rockets to carry them, Nazi Germany took control of Earth. This timeline was later negated by Captain Kirk and Spock, who used the Guardian to travel back to a point prior to McCoy's arrival, and prevented him from saving Keeler. (TOS: "The City on the Edge of Forever")
Even after the war and the abolishment of Nazis and their propaganda, groups of neo-Nazis occasionally arose from insular populaces. One latter-day neo-Nazi organization was started, as a twisted social experiment, by Human scientist John Gill on the planet Ekos. The Ekosians embraced Gill's rhetoric, eventually turning their hatred towards their nearest planetary neighbors, the space-faring Zeons.
As a cultural observer sent undercover and alone to the planet Ekos, Gill inadvertently showed just how powerful and dangerous the Nazi message could be, centuries after the fall of Hitler's Third Reich. Finding the planet in anarchy, Gill violated the Prime Directive, interfering with the planet's society in an effort to stabilize the situation by producing a more benign version of the NSDAP, emulating its efficiency to restore order. However, a subordinate, Melakon, subtly seized power by chemically incapacitating Gill and manipulated the populace into the same brutal racial supremacist policies of the original. Zeons were expelled from the Ekosian planet, or worse, rounded up into camps, just as had been done to the Jews on Earth. Even Gill was not immune, as his own Nazi party he designed used him as a puppet, drugged and helpless, to hide their ownership of the true dictatorial power. A landing party from the Federation starship USS Enterprise attempted to rectify the damage to that planet's society, removing Gill from power (he was eventually killed by Melakon when he denounced the usurper and disavowed his genocidal policies), and allowing a resistance effort (which included some very influential Party members) to co-opt power from the decapitated Nazis.
This is often quoted as a textbook example of the importance of the Prime Directive of non-interference, the dangers of technologically superior beings manipulating younger societies. (TOS: "Patterns of Force")
A pack of Hirogen ships successfully captured the USS Voyager and forced the crew to participate in vast holodeck hunting simulations, brainwashing the crew to believe they were genuine characters in the holodecks while leaving a select minority outside to treat their wounds and create additional holobuffers throughout the ship. One of these simulations was of a Nazi occupied France during World War II. Various Hirogen hunters assumed the roles of Nazi officers and wore the uniforms of Nazi officers while working side by side with holographic simulated Nazis.
The Hirogen, resenting his Alpha's decisions had been partly convinced by the Nazi vision of superiority, having found some commonality in their philosophies, attempted to kill the Voyager crew until he was killed by Captain Janeway. (VOY: "The Killing Game", "The Killing Game, Part II")