The w3c has formal rules for constructing a urn. The syntax is urn:namespace:namespace-specific string. The namespace needs to be one of the standard ones or needs to be a number registered with IANA. You can’t just invent your own. However, you can just define a namespace as a guid - so urn:uuid:[your guid here]. All that said, your implementers will look much more kindly on you if you use a URL because that’s going to be human readable and understandable and, in the ideal state, will actually resolve to the code system you’ve defined - which lets others understand what the heck your codes actually mean.
Do you mean, while it is restricted to use non-registered URNs, it is okay to use non-registered URLs?
So for me, it will be something like: https://mysite.com/fhir/{mycustomcodetype} ?