Petrol stations have them - although these are often not very clean or nice!
Rail stations have them & price varies. In Leeds, if you're already onto the departure platforms, the loos on that side of the ticket barrier are free. But outside the ticket barriers, it's 30 pence. I've seen other rail station toilets for 20 pence.
Some towns, villages & parks have free public loos in the city centre.
Also, I know I can always count on a stop into Marks & Spencer, or Debenhams, etc. I've used the loo in McDonalds before here (without buying anything - the staff could not have cared less, lol!) - but usually you'd be expected to purchase at least a drink (bottle of water?) or something to use the toilet in a restaurant or somewhere like McDonalds, Starbucks, etc.
If you're travelling along in a car on the motorways, there will be 'Services' stops - somewhat similar to 'Rest Areas' in the US. At a 'Services' stop, there will usually be a petrol station, one or more restaurants (Costa, Starbucks, Little Chef, M&S Simply Food, WH Smith, etc etc) & public toilets that anyone can use - whether you're buying something or not. These may or may not have a fee to use.
HTH!
Also I understand there is a mobile app you can put on your Iphone - probably Android too - for finding public loos!