Strictly speacking you can use unlink to delete directories but it works differently than rmdir. For example you can unlink directory which has some files in it and it likely to leave you with corrupted filesystem but you cannot do same with rmdir which will just fail in this case.