Making sense out of byte-order in text
I'm not sure this is the right place for this question. Anyway, hexdump is interpreting your input as a 16-bit little-endian number, therefore the bytes 0x61 and 0x62 (which leave the pipe in the "correct" order) appear reversed. Try printf "ab" | hexdump -C .

00000000  61 62                                             |ab|
00000002