In addition to what the previous answer said, some background on the cd command:

When you cd, you should get this error:

$ cd /etc/docker/
bash: cd: /etc/docker/: Permission denied

When you sudo cd /etc/docker/, you are likely to get an error like this:

$ sudo cd /etc/docker
sudo: cd: command not found

But I guess there could be distros where you don't get that, and there actually is a cd binary. However, this binary should never work, because it would change the shell's child process' current directory (i.e. the current directory of the cd process), rather than the shell's current directory.

Maybe try doing which cd and executing the result. You will most likely see that you cannot change directories with this binary, even if you do not use sudo.

So use e.g. sudo -s to get a root shell and then cd around.