Yes, under certain conditions (my knowledge only extends to U.S. laws; i do not speak for other countries' laws).
A visa does not automatically guarantee entrance into the US, it merely grants legal permission to apply for entry. There are several legal grounds by which a visa holder may either be refused entry, denied entry, have the visa revoked, and or be detained upon attempting entry. I cannot go over all of them here, but I'll give a short overview.
1. A fraudulently-acquired visa. 2. An altered visa. 3. The visa of another person. 4. A counterfeit, fake or false visa. 5. A visa that doesn't match the intent of the entry (tourist visa being used to seek employment; a marriage visa used for tourism). 6. The person is on a watch list. 7. There is a want or warrant for the person's arrest. 8. Adverse information has been discovered (medically unfit; drug abuser; plans to overthrow US government; will become a public charge). 9. Lack of proof of plans to depart US after visa expires. 10. Bringing in prohibited items, or involved in any criminal activity upon entry (smuggling contraband or people). ~
If they have a legal visa it is not right to detain anyone. Every time a person leaves a country or enters a country his or her visa and passport is thoroughly checked. During the time of check-in all passports are checked and verified,only then each traveller is allowed to enter a plane. When he or she enters a new country,the immigration authority again throughly checks the visitors passport and sees if he or she is travelling on a valid visa.