In england-and-wales, aside from the contractual issues, this is also a potential breach of the Equality Act 2010, the Human Rights Act 1998, and/or the European Convention on Human Rights (on which the HRA is based and which the UK is still a signatory to i.e. not to be confused with the EU Charter of Fundamental Rights).
Per section 4 and 9(1)(b) of the Equality Act 2010, being Russian is a protected characteristic. Sections 13(1) and 19(1) define direct discrimination as "A person (A) discriminates against another (B) if, because of a protected characteristic, A treats B less favourably than A treats or would treat others" and indirect discrimination as "A person (A) discriminates against another (B) if A applies to B a provision, criterion or practice which is discriminatory in relation to a relevant protected characteristic of B's."
Being discriminatory isn't by itself sufficient to break the law. For that the discrimination needs to be unlawful. Terminating a service based on nationality is unlawful discrimination pursuant to section 29(2) which provides; "A service-provider (A) must not, in providing the service, discriminate against a person (B) [...] by terminating the provision of the service to B [...]".
Any clause in a contract which purports to allow the service provider to terminate in a way which constitutes unlawful disrimination is unenforceable pursuant to Section 142(1) which provides; "A term of a contract is unenforceable against a person in so far as it constitutes, promotes or provides for treatment of that or another person that is of a description prohibited by this Act.". To reinforce this point, section 144(1) provides that you cannot contract out of the Equality Act 2020 (i.e. you cannot agree that the Act won't apply; such a clause is unenforceable).
The most relevant exception comes from Section 196 and paragraph 1 of Schedule 23 which has the effect that the service provider doesn't unlawfully discriminate if the terminatation is done in pursuance of legislation or arrangements made or conditions imposed by a government minister.
It's also hypothetically possible to find an exception based on national security based on section 192 which provides; "a person does not contravene this Act only by doing, for the purpose of safeguarding national security, anything it is proportionate to do for that purpose". It's hard to see how a blanket policy of terminating all Russian customers could be a proportionate response to an issue of national security. I could see this provision being useful if a specific customer was known to be a national security threat and only they were being terminated.
What this means in practice is that terminating based on Russian nationality is likely to be unlawful discrimination unless it is done to comply with the law or a government decision. Thus, terminating a contract with Roman Abramovich might be lawful if done in pursuance of government sanctions against him, but blindly terminating all Russian customers is probably unlawful unless sanctions are in force which cover the specific service or sector.
Human Rights Act 1998 (HRA) and European Convention on Human Rights (ECHR)
Finding a law which permits the discriminatory termination isn't necessarily the end of the story. The HRA is a "constitutional" Act which theoretically means that Parliament shouldn't pass any other Act which contravenes the HRA (albeit the principal of Parliamentary sovereignty means that in practice it can; this is because we don't have a separate category of Acts which can sit above other Acts).
The HRA has the effect of importing most of the ECHR into domestic law. Article 14 of the ECHR provides (emphasis added):
The enjoyment of the rights and freedoms set forth in this Convention
shall be secured without discrimination on any ground such as sex,
race, colour, language, religion, political or other opinion, national
or social origin, association with a national minority, property,
birth or other status.
This means that if Parliament passes an Act which purports to permit discriminatory termination of a contract for a service which falls within scope for any of the Convention rights, the Act will breach the ECHR. An example of this might be terminating a contract for the provision of housing which could be within scope for Article 8 (right to family life and home). The courts have over the years been quite creative in making scenarios fit within the Convention rights, which were drafted in very broad and non-specific terms.
The HRA and ECHR also contain exceptions e.g. Article 15 of the ECHR which has the effect of allowing contraventions of Convention rights "in time of war or other public emergency threatening the life of the nation [...] to the extent strictly required by the exigencies of the situation".
If an Act contravenes the HRA in a way which is ambiguous enough to permit for different possible interpretations, then Section 3 provides that the courts must interpret in the way which is compatible with the ECHR.
Failing that, the High Court and upper courts can make a "declaration of incompatibility" under Section 4(2). Per Section 4(6), this does not carry any legal force, but in accordance with constitutional principles the government is then supposed to amend the law to be compatible. Ultimately, if a claimant has exhausted all legal remedies within the domestic jurisdiction, they can bring a claim to the European Court of Human Rights.
There have been many media articles recently describing all sorts of situations in which Russians are being penalised simply for being Russian. I do suspect that many of these will breach the Equality Act and that we will be seeing many cases being argued and possibly won in the courts. Perhaps more shockingly, the government recently hinted that it may even target law firms which represent Russian clients trying to launch legal challenges, which to me seems a clear breach of Article 6 of the ECHR (right to a fair trial). The correct approach in my view would be for the government to focus on making sure its sanctions are legally watertight rather than trying to prevent them being challenged.