In this medical context, having a virus means that one has contracted the virus, or that you have been infected with the virus. In other words, they have been previously exposed to the virus, and now carry the virus (or perhaps more accurately, its antibodies) in their bodies.
In the sentence you quoted, the term "give protection" can imply that the exposure to the virus was via vaccination. The sentence then reads as saying that if someone is vaccinated with just one of the four strains (types) of dengue virus, they will only be protected against that type, and not the other three.
I'm using contract in the following sense:
Contract verb
3 [with object] Catch or develop (a disease or infectious agent): three people contracted a killer virus
- ODO