Each country has been assigned their own Country Code (generally in accordance with ISO 3166-1) and have the entitlement to control domain name registrations under that country code. For example, Australia has the country code 'AU' and all domains under '.au' are controlled by the .au Domain Administration (auDA).
Each country code can have different registration requirements, including whether domain name registrations can occur directly under the country code (such as .cc) or whether registrations can only occur under stipulated second-level domains (SLDs). For example, auDA designates which second-levels are available for registration under .au (such as .com.au, .org.au, etc)
For a rather large listing of country codes, refer to the following Wikipedia entry:
https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains