They’re intently watching Venezuela in Iran. The revolutionary regimes in Tehran and Caracas are birds of a feather. True, one is Islamist green, the other socialist red, but in some ways they are as similar as that blue-gold dress in the viral internet meme of a few years ago.

As it celebrates its 40th anniversary this week, the Islamic Republic faces growing internal dissent and external sanctions. Ditto for the Bolivarian Republic, born at the turn of the century and now broke and on the verge of collapse.

Venezuelans, with help from world capitals led by Washington, seem close to toppling the oppressive, corrupt regime that misrules them. Don’t be surprised if Iran follows a similar course. There, less visible but widespread protests continue to cast doubt on the mullahs’ grip on power.

In both cases, once-strong popular regime support has vanished. Tumbling oil prices and sanctions aside, corruption and mismanagement have transformed two of the world’s leading petroleum ­exporters into basket cases.

The mullahs, like Venezuela’s socialists, are more interested in exporting their revolution abroad than helping their people. And both run police states with sham elections that lend a veneer of democratic legitimacy. No wonder the two are such close friends.

The late Hugo Chávez saw the potential in a Caracas-Tehran alliance early on. He would pop up in Tehran often, merging the Latin-tinged “Yankee Go Home” with the Persian “Death to America” chants.

Daily direct flights between ­Caracas and Tehran were soon established. Tehran’s Lebanese proxy, Hezbollah, and other Iranian operatives use Venezuela for money laundering. Iranian officials seeking to evade US sanctions can easily obtain Venezuelan passports.

Now the two regimes find themselves in the same boat.

True, Tehran isn’t as universally despised as Caracas is today. Europeans are so enamored of President Barack Obama’s nuclear deal that they are deaf to human rights violations — and blind to the Iranian terrorism and missile testing threatening their continent.

But European solicitude for Tehran can only go so far. European conglomerates once more shun the Islamic Republic under US pressure.

Some in Tehran’s ruling circles, including former President Mahmoud Ahmadinejad, openly fret that the regime may collapse. Watching Nicolás Maduro’s ­regime flailing, Iranian officials must wonder if they are next.

President Trump is only heightening their fears. His administration has adeptly used pressure points in support of Venezuelan and Iranian regime opponents.

The Iranian dissidents confront a more uphill battle, to be sure. In Venezuela, “there’s still space for some opposition,” says Alireza Nader, president of the New Iran Foundation, a Washington-based group supporting dissidents. By contrast, he says, anti-regime Iranian leaders are instantly imprisoned, tortured and often killed.

While the Venezuelan opposition leader Juan Guaidó, who was sworn in as interim president, enjoys support from democracies everywhere, Iranian opposition leaders inside the country are cut down. US-based figures, like Reza Pahlavi, the son of the late shah, are popular inside — but they aren’t there.

That hasn’t stopped Secretary of State Mike Pompeo from publicizing his one-on-one meeting this month with Masih Alinejad, a Brooklyn-based Iranian activist who campaigns against the mandatory hijab.

The State Department session created quite a stir inside the country, where Alinejad has a huge following. The regime renewed threats against her family and denounced her as a traitor and worse.

Talking to Pompeo, “I stressed the importance of free elections in Iran, where all candidates must be allowed to run, and all votes must be counted,” Alinejad tells me. She also asked Pompeo to amend the travel ban to target regime figures instead of ordinary Iranians.

In Venezuela, Alinejad observes, injustice festered, and after an illegitimate election, the streets erupted. Iran’s clerics — who so fear Alinejad and other Iranians yearning to end oppression — must tremble as they watch their old Caracas allies teeter.

Twitter: @BennyAvni