Watching angry protesters waving placards outside a Birmingham primary school brought it all back for Khakan Qureshi. A softly spoken gay Muslim in his early 40s, he vividly remembers Margaret Thatcher denouncing the fact that children were being taught they “have an inalienable right to be gay” and introducing section 28 – the toxic product of Tory homophobia and a hysterical media moral panic – to prevent the so-called promotion of homosexuality in schools. Now, in 2019, picketers – mostly, but not exclusively, from a Muslim background – are demanding that schools cease their LGBTQ-inclusive education. “I feel sad that I had to experience all that sort of mental angst all those years, being bullied, being picked on, being mocked,” he told me. “I just think that children should be allowed to be who they are, let us be who we are, let Muslims be who they are.”

Like other LGBTQ people who went to school before the repeal of section 28 in 2003, I too grew up in its shadow: I was never taught about LGBTQ issues, except when a teacher told a class that anal sex was bad for your health. The damage inflicted on LGBTQ people was incalculable: hearing homophobic language casually thrown around in the playground, absorbing the homophobia peddled by much of the media, fearful of rejection from family and friends, and no one to tell you you’re not alone, that there’s nothing wrong with you.

Q&A What was Section 28? Show Introduced by the Thatcher government, Section 28 of the Local Government Act stated that a local authority shall not 'intentionally promote homosexuality or publish material with the intention of promoting homosexuality' or 'promote the teaching in any maintained school of the acceptability of homosexuality as a pretended family relationship'. As well as the impact on LGBT pupils, it also prevented councils from funding much-needed lesbian and gay initiatives at a time when the community was struggling to cope with the Aids epidemic. Despite huge protests, and even a live interruption of the BBC’s Six o’clock news, it became law in 1988.

When Tony Blair’s Labour won the 1997 general election they promised anti-discrimination legislation, but did not make any specific mention of Clause 28.

The Labour/Lib Dem coalition in Scotland repealed Section 28 in June 2000, despite a huge advertising campaign supporting it bankrolled by Stagecoach tycoon Brian Souter.

Labour first attempted to repeal it in England and Wales in July 2000. But under a three-line whip, Conservative MPs opposed the move, and the bill was ultimately defeated by bishops and Tories in the Lords.

Labour’s new Local Government Act eventually took it off the statue books in September 2003, although at least one local authority, Kent, passed their own rules to continue to make it illegal to teach about same-sex relationships in schools under their control. This was finally outlawed by the Equalities Act 2010.

If you listen to the protesters, you’d think that the No Outsiders programme – designed by Andrew Moffat, assistant headteacher at Parkfield community school – was teaching young children about gay sex. In truth, it’s about simply letting them know that gay people exist, that people are different, and that’s OK: one of the books in the programme features a chameleon who’s only happy when he’s finally himself; another shows different types of families – some have two parents, some have one, some are white, some are black, some have two mothers; another is a picturebook about a child with two mums doing all the normal things families do together. As Moffat emphasises, it’s about preparing children to live in modern Britain, with all its diversity. Taking away this basic education will inflict the same harm that previous generations of young LGBTQ people endured.

The dangerous conclusion to draw from this saga is that Muslims and LGBTQ people are on a collision course. That is certainly the battle cry of ever more emboldened Islamophobes, who never talk of LGBTQ rights except when it becomes convenient artillery in their bigoted war on Muslims. If you only talk of LGBTQ rights to attack Muslims then you do not care about those rights: and for those of us who have been attacked by homophobic far-right activists in the streets but have never endured homophobia from Muslims, there is a perverse irony at work. In any case, we are not talking about two discrete groups: some Muslims are gay or trans, and vice versa. But in truth, LGBTQ people and Muslims should be allies: above all, because we share many of the same experiences and enemies.

Sadiq Khan at Pride in London in 2018: ‘A long track record of backing and campaigning for LGBTQ rights.’ Photograph: Wiktor Szymanowicz/REX/Shutterstock

“We should be talking about how there’s a shared level of oppression between LGBTQ people and Muslims,” said Ezra Stripe, of Hidayah, a British LGBTQ Muslim organisation. “Even if you don’t agree with someone’s sexuality, you should respect it, because they’re going through a similar experience to Muslims.” Donald Trump rose to power demonising Muslims and introducing the Muslim ban; he went on to attempt to ban trans people from serving in the US military and erase trans people as an identity, and watering down LGBTQ anti-discrimination protections. The same newspapers that relentlessly hounded gay people now have both Muslims and trans people in their sights. “The way the rightwing media has fuelled hatred towards trans people and Muslim people has been happening in tandem over the past few years,” said British-Iraqi drag queen Amrou Al-Kadhi, “and so there is a similar intersection of intolerance that queer people and Muslim people face when it comes to violence from the right.” Al-Kadhi faces attacks from multiple directions: from conservative Muslims for being queer, from rightwing gay people for being Muslim and Arab. Al-Kadhi noted how many French gay men voted for the far-right National Front, a party which campaigned vociferously against equal marriage. Indeed, I remember – while working as a barman in Manchester’s Gay Village over a decade ago – a fellow member of staff refusing to serve a customer they thought was a Muslim (he was, in fact, a Sikh).

There are those, like Hidayah, who dispute conservative interpretations of Islamic scripture forbidding homosexuality, but a theological battle does not have to be won to establish bonds of solidarity between two oppressed groups who are liable to have had abuse yelled at them on the streets by the same people. It is striking that, in the US, a majority of Muslims support equal marriage, unlike a majority of white Christian evangelicals who are opposed. London’s mayor Sadiq Khan – the first Muslim mayor of a major western city – has a long track record of backing and campaigning for LGBTQ rights such as equal marriage, and for using his platform to oppose transphobia. Mehdi Hasan – the most prominent British Muslim commentator – has passionately confronted homophobia.

The protests outside schools are disturbing, and their demands must be resisted: children must be taught that difference exists and that difference is OK. But it would be a tragedy to perpetuate bitter divisions between two oppressed and long-vilified minorities. It would be naive to portray this as straightforward: all oppressed groups are capable of their own oppression, as homophobia among Muslims and Islamophobia among LGBTQ people reveals. But a far right on the rise from Brazil to the US to Italy to Britain represents a grave menace to both Muslims and LGBTQ people. It would be tragic if we learn that to stand apart is to fall together.

• Owen Jones is a Guardian columnist