I remember how we drove down a motorway from Harwich to Leicester, and at one point, there was a pedestrian crossing.
As I recall, there was a public footpath there whose route crossed the road at that point, and when the road was upgraded to a motorway, they kept the path of the public footpath intact.
There were steps up and down the banks(?) that had been constructed (presumably to reduce noise) on either side of the motorway, and lines painted across the surface of the road, and a small pedestrian island in the middle; there were also warning signs to motorists.
I presume that the expected low number of travellers along that footpath, along with the hallowed status of public footpaths, contributed to this rare(?) situation where a pedestrian may cross a motorway.