Not sure if it's everywhere - but where I am it is actually illegal to cross when it says don't cross and you can get a ticket for it. (not saying it's actually enforced).
The history of such laws are interesting, by the way.
That said, most of the time and in most places I've been, the de facto reality is that it's essentially lawless. Neither pedestrians nor drivers are being policed effectively and they all kind of do whatever.