score:17
Like any country, a visa is just an endors*m*nt allowing you a specific period of time in a country based on your citizenship (and other potential factors).
However, once you're at the border, the border agents / authorities can and will still make a further assessment. They might evaluate:
as a result, yes, even if you have a legitimate visa, it's still possible (generally unlikely, but possible) for you to be rejected at the border.
For another question we have which is related to this, see Being denied entry to Israel due to political activism?