You may also be required to pass tests and or pay licence fees. You are meant, for instance, to have a licence and pay fees before you can drive your car on public roads. All kinds of rules govern what you may and may not do in this public space. There are restrictions on your ability to call public meetings in publicly-owned space. There are also dress codes plus a myriad of laws designed to keep the peace.
Private space carries the same limitations.
Any person who owns property is able to set rules or demand that certain standards of behaviour are observed on their property. Commercial entities such as restaurants can require dress and behaviourial codes. They can also have conditions placed on the way they use facilities which are open to the public. A restaurant, for instance, cannot refuse to serve people based on their race. But a private club may be able to restrict membership based on, say, religion.