In usual conditions, all commands in TeX must be preceded by a backslash, to tell TeX that they are commands, so instead of
\newcommand{hs}[1]{\hspace{#1}}
you need
\newcommand{\hs}[1]{\hspace{#1}}
which will work as you expect.
Side note: If you just want to create a copy of a command with another name, you can use \let: \let\hs=\hspace. With the \newcommand approach the \hs command will use \hspace, and with the \let approach it will be a copy of \hspace. One advantage of the latter is that \hs*{argument} will work as you'd expect. With \newcommand it won't.
The second version adds an extra pair of braces that shouldn't be there, so it won't work as well.
\hspace{{1cm}} will expand to \hskip{#1}\relax, which isn't valid syntax and will throw you a Missing number error.
The third version is the same. The unit will only appear after the Missing number error, so it is of no use there. Besides, TeX doesn't know the unit px, so even if you remove the braces you'll still get a Illegal unit of measure.
The fourth contains, besides the illegal px unit, two problems. The first is that in usual circumstances numbers aren't allowed in command names, so you can't use \hs1. The second is that the first optional argument of \newcommand (the number of arguments) must not be empty ([]). An empty argument is very different from a missing argument! If you try to do that (after removing the number from the command name) you'll get another Missing number error because LaTeX was expecting a number there.
\newcommand{\hs}[1]{\hspace{#1}}. Add a backslash and it will work. The and third versions add braces that shouldn't be there, so they won't work. The fourth version won't work because numbers can't be in command names, and the first optional argument to\newcommandcan't be empty. – Phelype Oleinik Jan 25 '19 at 18:12\newcommandto work. – daleif Jan 25 '19 at 18:13\newcommandworks in MathJax. – egreg Jan 25 '19 at 18:24