Like many other forum users I'm not acquainted with the Cobb at Lyme Regis where the recent tragedy occurred, so am not qualified to make proper comment on it. However, from a general perspective, I generally share the views already expressed by Betta Spenden, RayRapp and Stuff4blokes. In addition to unfenced river banks and cliff faces, the edges of canals in the UK generally are unfenced, even in towns, villages and cities where significant numbers of people are likely to approach or walk/cycle beside them. Though canal lock chambers by their nature can pose a particular hazard to the unwary, especially when the water in them is at the level of the lower adjacent stretch of canal, they are usually unfenced. I've walked and cycled considerable distances along canal towpaths and can't remember seeing any locks which did have fencing. This is because it's simply not practicable to enclose lock chambers with handrails or provide them for most stretches of canal towpaths.
By the same token it's generally not practical, for various reasons, to have fencing (handrails/barriers) at harbours and docks. During my early HSE days this was explained to me by senior inspectors when I first started to inspect such places. It was reflected in the Docks Regulations of 19XX which generally allowed unfenced edges, but did require barriers to be provided at and highlight corners and other changes of direction of such edges. I recall that the regulations also required vertical sides of docks and harbours to incorporate escape ladders at requisite intervals, plus lifebelts, etc.
Though the lengths of unfenced stretches of docks and harbour sides in the UK are likely to total many miles, many locations are open to the public. This includes people who are under the influence of booze and/or other drugs, with young children, with pets, unaccompanied children & teenagers, etc - and yes, sometimes, sadly there are incidents at such places, some with tragic outcomes. Most if not all dock and harbour areas which are accessible to the public probably have warning signs. Also, from recollection of a sizeable and publically accessible Scottish harbour I used during a holiday last month, some lengths of the harbour edges had baulks of timber (similar in shape and size to wooden railway sleepers) secured to them. Such timbering seemed to provide a reasonable compromise in that they 1) indicated the presence of the harbour edge and 2) would tend to prevent vehicles, pushchairs and wheelchairs from going over the edge, and yet still allow boats, notably fishing vessels, to be loaded and unloaded.