Country A cannot prevent Country B from issuing visas to citizens of Country A.
The right to issue visas is sovereign to each nation's issuing authority.
As mentioned in other answers, any country can restrict exit from its borders. This is done usually through exit visas, but sometimes it can be achieved by instituting additional requirements of their citizens.
India, for example, has the Emigration Check Required (ECR) (Bureau of Immigration) rule, which states:
As per the Emigration Act, 1983, Emigration Check Required (ECR)
categories of Indian passport holders, require to obtain "Emigration
Clearance" from the office of Protector of Emigrants (POE), Ministry
of Overseas Indian Affairs for going to following 18 countries.
United Arab Emirates (UAE), The Kingdom of Saudi Arabia (KSA), Qatar,
Oman, Kuwait, Bahrain, Malaysia, Libya, Jordan, Yemen, Sudan,
Afghanistan, Indonesia, Syria, Lebanon, Thailand, Iraq (emigration
However , the Ministry of Overseas Indian Affairs (Emigration Policy
Division) have allowed ECR passport holders traveling abroad for
purposes others than employment to leave the country on production of
valid passport, valid visa and return ticket at the immigration
counters at international airports in India w.e.f. 1st October 2007.
If the RPO has issued Indian passport either with endorsement of
“Emigration Check Required” or no endorsement of “Emigration Check
Required” in the passport, POE clearance is required only when there
is “Emigration Check Required” endorsement in the passport.
Kuwait issues restricted passports to its stateless residents which allow them travel on a case-by-case basis. The person has to surrender the passport upon return.
You may also be subject to additional scrutiny (or be arrested!) upon your return if you have violated the country's exit laws. This is most common in countries that still follow conscription.
Egypt has such rules, restricts exits (source: wikipedia) and does imprison defaulters if they happen to return within their obligation period.
Service is postponed for students until their studies are finished,
before they turn 25 years old and they can not travel abroad without
travel permit from the Ministry of Defense.