It may be tempting to chalk up Sean Penn’s recent encounter with Mexican drug lord and prison escapee Joaquín “El Chapo” Guzmán to the actor’s long-standing penchant for inserting himself into the heart of geopolitical intrigue. But the episode continues a well-established tradition of symbiotic codependence and mutual regard between Hollywood and organized crime.

Like Fred Astaire and Ginger Rogers (“He gives her class, and she gives him sex”), organized crime and Hollywood have given each other what they needed most, whether in the form of capital, muscle and the alluring aroma of danger on the one hand, or legitimacy, proximity to celebrity and a glamorous public image on the other.

From the days when Charles “Lucky” Luciano and Al Capone battled over Hollywood turf, to Chicago mob associate, lawyer and legendary fixer Sidney Korshak pulling strings so that MGM would let Al Pacino play Michael Corleone in “The Godfather,” show business and the mob have fit together like a brass-knuckled hand in a silk opera glove. The relationship goes back at least to the 1920s, when the Chicago “outfit” — which controlled the labor unions — arrived in Los Angeles to help studio executives ride herd on their crews. As Gus Russo, who wrote about Korshak in his book “Supermob,” told me, Hollywood “was a mob town” for decades, possibly into the 1980s.

“Many of the movies you know and love were brokered by the Chicago outfit, with their extensive labor pull,” Russo said. A particularly toothsome bit of legend and lore has it that Jill St. John got her role as a Bond girl in “Diamonds Are Forever” thanks to her friendship with the intimidatingly well-connected Korshak — who, let the record reflect, was never indicted or convicted for any crime.

Sean Penn and then-fugitive Joaquín “El Chapo” Guzmán on Oct 2. After a long dinner and conversation, Guzmán granted Penn’s request for a formal interview, which was published in Rolling Stone. (Courtesy of Rolling Stone)

“Let’s just say that a nod from Korshak, and the Teamsters change management,” the producer Robert Evans wrote in his book “The Kid Stays in the Picture.” “A nod from Korshak, and Santa Anita closes. A nod from Korshak, and Vegas shuts down. A nod from Korshak, and the Dodgers can suddenly play night baseball.”

Perhaps the most valuable things organized crime and Hollywood have given each other, of course, are stories. From Jesse James and Capone — whose underlings reportedly consulted with “Scarface” screenwriter Ben Hecht — to “Bonnie and Clyde” and “Goodfellas,” the exploits of criminals and outlaws have been Hollywood’s most reliable fodder, with the miscreants themselves being the movies’ most ardent audience. As “Godfather” author Mario Puzo told Vanity Fair’s Nick Tosches in 1997, “The word ‘godfather’ had never been used in a Mafia sense.” But after the book and the movie were released, he said, “they even started calling themselves godfathers. It’s a fairy tale.”

In the case of Penn and Guzmán, that fairy tale has taken a pointedly surreal turn, the result not just of Hollywood’s congenital fascination with tough guys, but also a media culture in which heroes and villains are now empowered to be their own Brothers Grimm. Whereas 1931’s “The Public Enemy” was adapted from an (unpublished) novel by two former colleagues of Capone’s, and both “Goodfellas” and the book that inspired it were written by journalist Nicholas Pileggi, such formalities are laughably obsolete in the era of Twitter, citizen journalism and PR-savvy self-branding.

When Guzmán reached out to actress Kate del Castillo, who had previously tweeted supportive words for the drug kingpin, he was simply following the new rules of Controlling Your Narrative, whereby the subject neatly bypasses pesky institutions such as law enforcement and journalism and tells his story directly to the people or by way of an admiring interlocutor. In seeking to burnish his public image through a great-man biopic, Guzmán was following in the footsteps of Mexican revolutionary leader Pancho Villa, who enlisted director D.W. Griffith to act as his cinematic Boswell (in “The Life of General Villa,” which Griffith didn’t direct, the subject played himself). Or maybe Guzmán wanted to commission a big-screen version of a narcocorrido, the lilting Mexican folk song wherein notorious drug dealers and murderers are romanticized as populist heroes.

Whatever Guzmán had in mind in terms of genre, he was confident in the knowledge that Hollywood loves a colorful antihero, especially one who has built an empire beyond the reach of the law. It’s safe to assume that he was hoping to establish a persona on a par with “Scarface” — the 1983 remake starring Al Pacino that has been elevated to pop culture myth — rather than “Escobar: Paradise Lost,” which opened last year to near-universal indifference.

As if Guzmán’s ambitions weren’t addled enough, del Castillo brings with her the piquant fact of having played the head of a Spanish drug cartel in the Telemundo soap opera “La Reina del Sur.” Penn’s curious role in the episode remains murky, as the authorities and the public at large sort out whether he was a useful idiot for Guzmán or, far more tantalizingly if unlikely, a crucial covert player in returning a fugitive to justice. It’s understandable that the shadowy world Penn entered to make contact with Guzmán — complete with burner phones, encryption and dead-drop email addresses — might flatter the vanity of a dashing leading man whose most recent screen role was a dashing mercenary.

Whatever his motivation, Penn’s contribution revealed that Rolling Stone was just as susceptible to celebrity as was the star-struck Guzmán: Not only did the magazine apparently agree to print the actor’s florid 11,000-word story unedited, but it submitted the article to Guzmán for approval before going to press.

The facts of the case will emerge in the fullness of time — most likely, thanks to the efforts of reporters, not movie stars. In the meantime, a bizarre foray into life imitating — and almost instigating — art hints at what has kept the worlds of crime and entertainment in opportunistic thrall through generations, from their cultures of impunity to their shared capacity for colossal self-deception. Thankfully, this chapter has so far played out more like a twisted cautionary tale than a tragedy. However it ultimately turns out, you had better believe that, somewhere in the Hollywood Hills, a producer is busy optioning the rights.