Why can I ping 127.257, 127.1 etc?

Not only IPv6 allows consecutive zeros to be omitted.

Operating systems allow to skip octets when using dot-decimal notation.
It’s a relic from the old days of classful addressing. 127.1 means network 127, host 1.
e.g.

Note that this isn’t limited to the ping command.
It will accept decimal values too:

Upon finding that dot, it makes sure that you didn’t give it a value beyond 255 since that particular trick is only allowed for the last position, and a dot means more stuff is coming up. Per the comments:
/*
* Internet format:
* a.b.c.d
* a.b.c (with c treated as 16 bits)
* a.b (with b treated as 24 bits)
*/
Try to ping some of these and watch the differences:
111.1.1.0×09
127.0x0c
0xC0A80001
P.S. And, yes, 127.257 is legal, because network 127 can have more than 256 hosts.