Shell and BP are multinational corporations each of them operating in over 100 countries. Sources of revenue are diverse and whilst the U.K. is significant it is far from crucial to either company’s future. Both Shell and BP have chosen to be U.K. registered and they are major FTSE members. But they don’t have to be.

Both Shell and BP have upstream assets and are gas and oil producers in the U.K. but neither refines crude oil in Britain any more. Their downstream business – branded petrol stations included – are useful brand symbols but not major contributors to global revenues.
In short Shell and BP’s significance to the U.K. is exaggerated other than that they choose to be registered here. Both corporations have large tax departments whose primary responsibility is to minimise tax liabilities – e.g. by generating and/or posting profits in lower tax jurisdictions. Tax was a factor in Shell choosing to relocate corporately from The Netherlands to the U.K. So there will always be a close focus on tax and if for whatever reason the U.K. became less attractive then both companies have alternatives.
Production of hydrocarbons, mostly offshore at present, is carried out by companies like Shell and BP on strictly commercial terms. They pay Government for licences and then spend huge amounts of capital and revenue on the exploration and production initiatives. An adequate return on capital employed is required. Anything that raises costs, tax included, makes marginal fields less attractive.
A windfall tax on Multinational energy companies is far from straightforward given their very diverse sources of income and complex accounting arrangements. It’s not a magic solution.