This product is a Pharmacy Only Medicine in the UK, so it's perfectly legal to buy it from registered pharmacies, providing the pharmacist thinks this product is suitable for you.
That can be seen at the legal class on here https://www.medicines.org.uk/emc/product/4825/smpc