Both M1 and M2 don't allow hyphens or dashes in its store codes. There is backend validation against it. However, it is not clear why. Any idea?
1 Answer
The only explanation I can find is:
A code is an identifier and normally represents one word. Therefore it consist of characters of the word-character class. Also not starting with a number sounds like a named identifier. So your two-words use-case is not applicable on the code, as it represents one word. Therefore no non-word-characters are allowed.
So you've found you can use a single word within the path-component of the URI and you've found out that the store-code is not suitable for two words. An URL-rewrite and output filter can handle this.
Taken from Hakre's comment about Magento 1 but I suspect the same logic is added to Magento 2 -https://stackoverflow.com/questions/10353636/magento-dash-in-store-code