It's legitimate (well, it used to be legitimate) in both usage and specification.
x- is a common prefix for nonstandard (or "not yet standard") identifiers, often explicitly allowed by protocols, often a de facto convention by implementers.
x-gzip used to be widespread in HTTP/1.0 and originally meant that the format didn't yet have the name entered into the official Table Of Content Encodings maintained by IANA (if the table even existed back then). For example, Opera 4 or 5 used to send this token.
gzip token was made standard since HTTP/1.1, and indeed the HTTP/1.1 specification says that
x-gzip is an acceptable alias for compatibility purposes – it's certainly not something MDN just made up.
However, the big downside of this convention is that once the name gets standardized, the old
x- version still sticks around for decades and software have to support both. Often newly written documentation will intentionally omit the old aliases to discourage their use. See also RFC 6648, which discusses the history and even mentions this exact token in Appendix B.