This is because you dont have enough permission to create directory in hdfs. Try running this as sudo:
sudo -u hdfs hadoop fs -mkdir /sample
Alternatively if you want any user to be able to do this, you can change the permission property:
But this is not recommended because it compromises security.