I assume the command just doesn't work on 18.04, having to do with what works as an editor for sudo -e, sudoedit, and visudo in what versions of sudo.
That wouldn't change the behavior of sudo on 18.04, since before 19.10 it already preserves $HOME, but that doesn't address why sed -i 1s/^/#/ couldn't be used as an "editor."
Oh.
Is SUDO_EDITOR not used until recent versions of sudo?
That appears to be the case for visudo specifically.
On my 16.04 and 18.04 systems, the manpage for visudo doesn't mention SUDO_EDITOR. It appears that, until recently, SUDO_EDITOR has been used only by sudo -e and sudoedit, not by visudo. I also just got the same behavior you saw--where my default interactive editor opens--when I tried the command on a 16.04 system.
sudo -e/sudoedit and visudo are not using the value of EDITOR, VISUAL, or SUDO_EDITOR as a command name. If they were, this wouldn't work at all; there is no command called sed -i 1s/^/#/. What allows that to work is that the value is being used as a command name followed by zero or more arguments to the command. The filename of the temporary file is passed as a final argument after that.
The variable's value is split into arguments (or, if one doesn't consider the command name itself to be an argument, then split into a command name and arguments) at the spaces.
The parsing of sed -i 1s/^/#/ is done by sudo -e/sudoedit or visudo (or something they call). It's independent of the shell that's used to run them with an environment variable set to that value, and it doesn't observe the same rules as the shell does.
I don't know of any way to prevent it from being split on spaces.