(covers information from several alternate timelines)
The M1921/28 Thompson submachine gun, commonly known as the Tommy Gun, was an automatic projectile weapon developed in the United States of America in the 1920s. It became particularly recognizable as a symbol of organized crime in the first half of the 20th century, and especially of the Chicago gangsters. The Thompson fired the .45 ACP cartridge and its rate of fire depended on the specific model. The weapon was also adopted by the US military, and saw extensive use in World War II.
In an alternate timeline in which Germany invaded the United States, the resistance fighters used many weapons, including the military M1 Thompson, among others during an attack in 1944 on the facility where the Na'kuhl were constructing a temporal conduit. (ENT: "Storm Front, Part II")
Thompson submachine guns were also used in several of the Dixon Hill novels favored by Captain Jean-Luc Picard, which were set late in the gangster era, and one of these was wielded by the Slade Bender character. (TNG: "Manhunt") In the year 2063, Captain Picard lured two Borg drones into a holodeck on the USS Enterprise-E, disabled the safety protocols, and used a Tommy gun on the drones, killing them with the bullets. (Star Trek: First Contact)
The natives of Sigma Iotia II, a world that modeled itself after the book Chicago Mobs of the Twenties, left behind by the crew of the starship Horizon, almost universally carried the weapons in 2268, including the women. (TOS: "A Piece of the Action")
In 2374, as part of the holodeck simulation of the town of Sainte Claire created aboard the captured USS Voyager by the Hirogen to use for hunting, Commander Tuvok utilized a Tommy Gun in his role as a French Resistance fighter, during an attack on the Nazi headquarters in the town. (VOY: "The Killing Game")
When Tom Paris was given an ancient television set by his fiancée B'Elanna Torres as a gift in 2376, one of the shows he watched was the ancient Earth television serial The Untouchables, where one of the main characters could be seen handling a Tommy Gun. (VOY: "Memorial")