Library Dired Sort Menu (dired-sort-menu.el) lets you do what you ask.
From the menu, choose Dirs First, and choose any of these menu items at the same time (Dirs First is a toggle option):
See the screenshot at Dired Sort Menu.
(If you don't want to use a menu you can use its code to create ...
No, you cannot change the order of the keys in a hash table.
As @xuchunyang's comment points out, hash tables do not have an
order in the way you're thinking about them. From the elisp manual node
The correspondences in a hash table are in no particular order.
You may wish to order the keys in some form (say, for the purposes