Generally, many of the UK stockbrokers are not very helpful on this score, due to a combination of money laundering regulations and a tendency to regard overseas clients as a hassle. (The same problem is true for non-residents wanting to open an UK bank account.)
There are a handful of UK stockbrokers that indicate they will deal with non-residents, but investors report different levels of success opening and using accounts. It may depend on whether you are a UK citizen but non-resident, whether you are neither a citizen nor a resident, whether you are resident in the European Union (EU) or European Economic Area (EEA), whether you have a UK bank account and even who you speak to at the company.
The following firms have been reported to open online trading accounts for at least some non-residents and are probably worth investigating first: