What is minimal altitude that aircraft (rocket?) can fly above any country without any permission? I mean, at what altitude ends country's airspace?
Actually, what you're asking are two different questions- According to ICAO ( ICAO Annex 11: Air Traffic Services), Class G airspace is uncontrolled and aircraft can fly in the without ATC permission. The definition if Class G is left to the regulatory authorities of individual countries (in US, it is where the other airspace classes are undefined).
Where does the airspace of the country end is a completely different one and as of now, there is no agreed definition. The United Nations General Assembly Committe on Peaceful Uses of Outer space is still in the process of defining what exactly an outer space is.
What is minimal altitude that aircraft (rocket?) can fly above any country without any permission?
100 km, probably
the Kármán line, at an altitude of 100 km (62 mi) above sea level, is conventionally used as the start of outer space in space treaties and for aerospace records keeping. The framework for international space law was established by the Outer Space Treaty, which was passed by the United Nations in 1967. This treaty precludes any claims of national sovereignty and permits all states to freely explore outer space.
It depends on the country's level of aggression and anti-aircraft weapons. The U2 made several flights over the USSR at 70,000 feet without permission. Governments will always claim as much territory as they can get away with diplomatically and militarily. The ability to orbit is a practical limit, there is a zone where aircraft don't have enough air to maneuver yet there is enough air to quickly slow orbiting spacecraft. The airspace up into this zone is pretty well defended by large countries in the modern era, while small countries may not respond to relatively low flights.
As per Wikipedia there is no internationally agreed upper boundary of national airspace, but if there was it would be up to the countries themselves. Some equatorial countries define their airspace up to the geostationary orbit altitude at 35,786 kilometres (22,236 miles). The United States' FAA legislation ends at the upper boundary of class A airspace at 60,000 ft (18.3 km). Additionally, the FAA defines a space border at 264,000 ft (50 mi / 80.5 km).