So, if you want to have a stairway with specifications that do not meet the local building codes, you have a right to do so?
No more than you have the “right” to commit murder, rape or any other crime on your property. Yes you can do it but you also are subject to the consequences.
In your particular example, you can build it, but the city may make you tear it down.
Now I will also acknowledge that there is a debate on what exactly a city can or can not tell you to do with your property. My position tends to be very limiting on the restrictions that the city may place on you.