For protocolbuf order of fields is guaranteed because of the binary encoding it utilizes,so you can be confident to generate md5 checksum.
But for json it is not always guaranteed, here is the reference from official json specification for reference stating json objects are unordered and the behaviour of software that receives these objects are unpredictable :
https://tools.ietf.org/html/rfc8259#section-4
But most json parsers take care of this for you but to have an additional check you can always sort the keys of your json object before actually generating the checksum.