The decision to strip Shamima Begum of her UK citizenship on the basis she is of Bangladeshi heritage could have implications for millions of people who have family roots overseas, the mayor of London, Sadiq Khan, has warned.

Khan said the home secretary’s decision earlier this week “risks creating a second class of citizenship – one that can be removed at the whim of a politician”, and calls into question what it means to be British.

In a statement released to the Guardian, he said: “This could affect millions of Londoners of dual or immigrant heritage, and anyone who may be eligible for citizenship from another country. Sajid Javid hasn’t only exposed how insecure the citizenship rights of these people are, he has called into question the very nature of what it means to be a citizen of this country at all.”

Echoing the call of Jeremy Corbyn, the Labour leader, on Thursday, Khan said the teenager, who fled her home to marry an Isis fighter four years ago, should be returned to Britain and investigated here.

He said: “Shamima Begum left London to travel to Syria. She may have committed very serious criminal offences. She was born, raised and educated in London. She may well have been groomed here. It is right that the British authorities properly investigate her and ensure she faces justice here too.”

The mayor described the 19-year-old as “someone who doesn’t hold dual nationality”, as both she and the Bangladeshi government have insisted. The British government, however, appears to have determined that she either holds or is eligible for a Bangladeshi passport. It is illegal under international law to remove someone’s citizenship if to do so would make them stateless.

The mayor’s words echo those of the Muslim Council of Britain, which has said that the move against Begum “could send a chill down the spine of not just British Muslim communities, but also all Britons whose parents come from immigrant backgrounds”.

Javid’s decision “amplifies fears of a two-tiered citizenship system, sets a dangerous precedent, and demonstrates an abdication of responsibility”, it said.

Khan’s intervention came after Begum, currently living in a refugee camp in northern Syria with her newborn son, made a plea for “mercy” and said she was “willing to change” if she was allowed to return to Britain.

Asked if she had anything to say to politicians in Westminster, Begum told Sky News: “I would like them to re-evaluate my case with a bit more mercy in their heart, you know.”

Her family have also written to the home secretary asking for his help to bring Begum’s son, who was born last weekend, back to the UK, and confirming that they would challenge the decision to strip her citizenship in court.

Some have expressed alarm that British Jews could also potentially be vulnerable as a result of the law employed by Javid.

Adam Wagner, a barrister at Doughty Street chambers who specialises in human rights, said the home secretary’s action could set a precedent. “The problem is, once you start making these kinds of decisions, it’s in the public imagination that people can be stripped of their citizenship, and the home secretary comes under even more pressure the next time. You did it with X, why not with Y?

“Stripping someone’s citizenship is such a major attack on someone’s rights, it’s basically exiling them. And this case highlights it very starkly. Shamima is a British person, born in Britain, and she happens to have Bangladeshi parents. Lots of people in the UK have foreign parents. Is this law, for that reason, affecting lots of people who are from ethnic minorities? It’s quite possible it might be.”