There are two parts to this question: what your country is willing to let you download (and use), and where the vendor is willing to let people download his software (which may be influenced by the laws of his country).
Common pitfalls on distribution and use
For the first part, there are 200-odd answers, one per country (or other polity with specific laws on distribution of software). Common restrictions include:
- Copyright: Copyright law is similar in most countries, but details do differ. This rarely matters for the distributability of software, but it can change what you're able to do with the software, as the fine points of the license may be interpreted differently in different jurisdictions. In particular, some countries explicitly nullify restrictions against reverse engineering when the reverse engineering is performed for interoperability purposes.
- Patents: Patents may not forbid you to distribute the software, but if the software uses a patented algorithm, you may need to have a license for the patent holder in order to use the software. Note that the patent holder isn't necessarily the author of the software. Patent validity is decided country by country (or in some cases by supra-national entities such as the EPO).
- Cryptography: Most developed countries have ratified the Wassenaar Arrangement, which regulates the exportation of armaments, including cryptography. Nowadays, in democratic countries, cryptography tends to be considered more of an industrial matter than a military matter, and regulations have become considerably more liberal since the early 2000s. There are still import restrictions in place in many countries. The less freedom of speech your country has, the more restrictions you can expect.
- DRM: A number of countries have specific restriction on the production, distribution and use of software that may circumvent copyright protection measures. The US law is called DMCA; the European equivalent is EUCD (and its implementation is different in different EU countries).
- Imports: If you need to import the software, it may be subject to restrictions (up to an outright ban) or taxation.
Common pitfalls on software exports
If the software is produced in a different country, the laws of the country or countries where it is produced come into play, as well as and any country where it transits. If you are not a national or resident of the country or countries involved, and don't plan to visit them, you don't need to care, but the vendor does and may put technical or contractual measures into place.
A lot of software is produced in the United States. The US have rather more restrictions on software exports that most democracies (but fewer on internal distribution, thanks to their free speech laws). Export of cryptographic software is particularly regulated. PGP could famously not be exported as software (that was considered ammunition, the export of which was a criminal offense), but the source code could be exported in a book (that was considered speech, the export of which was a constitutionally-sanctioned right) and typed back in in another country. Nowadays it's often enough to merely declare cryptographic software for export.
There are further legal restrictions in the United States that prevent most kinds of exports, including software, to countries that the United States have economic sanctions about. Other countries have similar regulations, but usually less stringent or less strictly applied.
A lot of free software is pointedly distributed from a location other than the United States (typically Canada or Western Europe), in order to avoid US export regulations.
Contractual restrictions
Vendors may place restrictions in the license of the program, and may put practical limitations such as preventing downloads from certain locations. These restrictions are sometimes consequences of the laws in the vendor's locale: for example, a US vendor could be incriminated if they allowed residents of sanctioned countries to download their software. Sometimes, the restrictions are consequences of the vendor's commercial policies, for example because they want to set different prices in different countries.
Conclusion
If you think my answer makes things look too complicated, you're wrong. (If you think you can get away without bothering with all the complications, you may be right. But the regulations are there, whether you like them or not.) If you think my answer is anywhere near complete, you're wrong. If you think my answer is anywhere close to legal advice, you're a fool. I haven't knowingly written anything that's incorrect, but this is still just something some guy on the Internet wrote. Treat it with all the caution it deserves.