This is actually not a good example and should be fixed to show a better way to do this.
If the example simply used the byte[] directly, instead of changing to a pointer, the fixed{} statement would not be necessary, as the marshaler automatically pins reference types where possible. (It can't do this if a pointer is used as it has no way to know how large the buffer is.)
This assumes that the called function does not cache the pointer, for example for example to call back with asynchronously. In this example the IO is synchronous, however.