In the united-kingdom, the legal basis flows from the Sanctions and Anti-Money Laundering Act 2018. This allows regulations to be made for particular sanctions regimes, in this case The Russia (Sanctions) (EU Exit) Regulations 2019 and its several amendments, including three revisions this year. Under those regulations, the Secretary of State may designate individuals who are then subject to particular sanctions. A consolidated list is available for all individuals and organizations who have been named under any of the regulations, not just the Russia one.
Working backwards from the list, we see such names as Vladimir Putin, who has an asset freeze on the grounds that -
Vladimir Vladimirovich PUTIN is the President of the Russian Federation, carrying ultimate authority for the policy of the Russian government and Russian armed forces. In February 2022, PUTIN ordered Russian military forces to launch an invasion of Ukraine, undermining and threatening the territorial integrity, sovereignty or independence of Ukraine.
Thus, he has been named for the purposes of regulation 11, and the statement of reasons (required by regulation 8) refers to the specific grounds in regulation 6 by which a person can be added to the list. In this case, those grounds are 6(2)(a)(i) as interpreted by 6(3)(a),
(2) In this regulation, an "involved person" means a person who —
(a) is or has been involved in—
(i) destabilising Ukraine or undermining or threatening the territorial integrity, sovereignty or independence of Ukraine
(3) For the purposes of this regulation, a person is “involved in destabilising Ukraine or undermining or threatening the territorial integrity, sovereignty or independence of Ukraine” if—
(a) the person is responsible for, engages in, provides support for, or promotes any policy or action which destabilises Ukraine or undermines or threatens the territorial integrity, sovereignty or independence of Ukraine
For "oligarchs" who are on the list, the Foreign Secretary has specifically drawn attention to Gennady Timchenko, described as Russia's sixth-richest oligarch. The statement of reasons says:
Gennadiy Timchenko, hereafter TIMCHENKO is a major shareholder in Bank "Rossiya". Bank "Rossiya" is a key stakeholder in the National Media Group which supports Russian policy which is destabilising Ukraine. Following the annexation of Crimea, Bank "Rossiya" has expanded its bank branches and provision of insurance and investment throughout Crimea and Sevastopol; and offers support to military activities and the formation of major transport links and cards that allow the public to travel easily around the peninsula. Therefore, Bank "Rossiya" has supported the consolidation of Crimea into the Russian Federation by integrating the financial system following the annexation of Crimea. TIMCHENKO therefore is or has been involved in engaging in, providing support for, or promoting any policy or action which destabilises Ukraine or undermines or threatens the territorial integrity, sovereignty or independence of Ukraine. Additionally, TIMCHENKO is associated with a person involved in destabilising Ukraine or undermining or threatening the territorial integrity, sovereignty or independence of Ukraine.
These are the same regulation 6 grounds as for Putin, but with additional reasoning to draw the connection (also, a citation under 6(2)(d) for "associated with"). One reason for this text being required is to undercut any suggestion that the listing is because of "guilt by association". In judicial review, for which continue reading below, this kind of statement and the process that gave rise to it is powerful evidence against a suggestion that the Secretary of State was acting other than rationally.
We can now look back to the 2018 Act, which authorizes the 2019 Regulations and provides rules about how the Secretary of State can designate people. Detailed provisions in the Regulations trace back to rules in the Act about the shape of a sanctions regime; for example, the "asset freeze" of regulation 11 is within section 3 of the Act on "Financial sanctions". There are also procedural safeguards around the making of regulations, mainly relating to Parliamentary approval, and around the designation of individuals. For example, a designated person can ask the Secretary of State to be removed from the list, and under section 22(3) she must do so if the person doesn't fit the criteria by which they were originally included. That would include if they are no longer an "involved person", or if their designation were no longer deemed appropriate based on the purpose of the sanctions regulations.
As with other executive actions, judicial review is available (under Chapter 4 of the Act), which could bring in considerations of whether the Secretary of State acted within her powers, did so "reasonably", etc. Human rights grounds are also possible, in relation to procedural fairness (Article 6) or the right to enjoy property (ECHR Protocol 1, Article 1). Against those stand arguments on the public interest, UK compliance with international obligations, national security, the general integrity of the sanctions system, and so forth. It is plausible that if a claim reached this point, the Secretary of State would be able to show that the designation - as described in the statement of reasons above - was on sound policy grounds, was taken after a sober review of the evidence, and was proportionate in the circumstances.
There is not much case law on the 2018 Act, given its recency. One example is R (Youssef) v Secretary of State  EWHC 3188 (Admin) in which an Article 6 claim failed. That was in relation to UN sanctions against Al-Qaida, which is a different position from the one here, but it has some force for understanding the current UK system. The present Act was created partially in response to the judgement in HM Treasury v Ahmed  UKSC 2 against a previous version of the sanctions laws, and the 2021 case found that the new version was acceptable. The judicial review avenue and the requirement to give reasons are directly aimed at complying with Article 6. While a court could always potentially find another problem, the current Act and the Regulations are as watertight as the drafters can make them in the light of existing precedent.