Short answer: there are a lot of viruses, and they're all different. The answer to your question is going to be "it varies by virus". Some of the ways population density and urbanisation affect virus transmission are summarised very briefly below.
Any pathogen's ability to sustain itself relies on every infection causing, on average, at least one other infection. This is called the basic reproduction number or R0. The transmission rate of a pathogen depends on its transmission mode, but with some modes of transmission (like droplet transmission, a major route of transmission of viruses that cause the common cold) population density is important. There's an excellent explanation of density- versus frequency-dependent transmission here. This means that as people live at higher densities, the potential for transmission of some viruses increases purely because of that difference in density, while it has little effect on other viruses.
Critical community size
However, transmission rate is only part of the story. Assuming infected people eventually become immune, a pathogen can burn itself out before new hosts are born or immunity is lost. Stochastic effects become more important in small communities, and there is a critical community size below which pathogens tend to go extinct. Small or isolated communities cannot sustain the virus causing measles, for example.
Urban environments and transmission (and vector-borne diseases)
Urban environments aren't just higher density, they are different in potentially important ways. For example, some viruses need to be transmitted between vertebrate hosts by arthropod vectors like mosquitoes. If you don't have the mosquito, you can't get the virus. Viruses like yellow fever virus, dengue virus and Zika virus are primarily transmitted by Aedes aegypti, which nowadays breeds preferentially in urban environments, so as urbanisation increases the potential for transmission of these diseases also increases. Without adequate sanitation, the potential for faeco-oral transmission also increases at high population densities, for example. Things like sewage treatment, air conditioning and exposure to wildlife all affect transmission in important ways.
So, basically, it's complicated.