Lots of Americans in this thread. This sort of riding is legal and encouraged in the UK and can be done quite safely. Cycling groups put out videos showing these techniques: https://youtu.be/VNr762i9oQU
Obviously it's a fairly seasoned cyclist thing, and more and more cycle infrastructure is being rolled out so people don't have to do this, but I do object to people from North America in this thread applying their laws and cultural norms to another country where this is quite normal