Use single quotes and turn off escape handling in echo with the -E flag.
-E
echo -E '\0' should produce a \0 on both zsh and bash (and dash).
echo -E '\0'
\0
This is the standard (read portable) way to do it:
printf "\0"
Should work whatever the (Unix like) OS, whatever the shell.