There is no solid proof who "invented" the Margarita. The most accepted of all stories is that the Margarita was invented in October 1941, at Hussong's Cantina in Ensenada, Mexico, by bartender Don Carlos Orozco. One slow afternoon, Don Carlos was experimenting with mixing new drinks when a prestigious visitor arrived: Margarita Henkel, the daughter of a German ambassador, who lived with her husband Roy Parodi near the city in Rancho Hamilton. Don Carlos offered the drink to Margarita, and named it after her for being the first person to taste it. He concocted a mixture of equal parts tequila, orange liqueur and lime, served over ice in a salt-rimmed glass.
Another common story related the Margarita being invented a few years earlier at the Rancho La Gloria Hotel, halfway between Tijuana and Rosarito, Mexico, by Carlos "Danny" Herrera, for a former Ziegfeld dancer named Marjorie King. This story was related by Herrera and also by bartender Albert Hernandez, who is acknowledged for popularizing the Margarita in San Diego after 1947, at the La Plaza restaurant in La Jolla. Hernandez claimed the owner of La Plaza, Morris Locke, knew Herrera and visited Mexico often.
Another common origin tale begins the cocktail’s history at the legendary Balinese Room in Galveston, Texas where, in 1948, head bartender Santos Cruz created the Margarita for singer Peggy Lee. He supposedly named it after the Spanish version of her name, Margarita, and it’s been a hit ever since. 
The most plausible explanation, however, is that the Margarita is merely a popular American drink, the Daisy, remade with tequila instead of brandy, which became popular during Prohibition as people drifted over the border for alcohol. There is an account from 1936 of Iowa newspaper editor James Graham finding such a cocktail in Tijuana, years before any of the other Margarita "creation myths". Margarita is Spanish for Daisy. It is likely that Orozco and Herrara merely perfected the "Tequila Daisy".