Given the exceptional potential of dendrimer macromolecules for numerous biomedical applications, we performed extensive coarse-grained molecular dynamics simulations to investigate the role of electrostatic interactions in complexes comprised of cationic dendrimers with oppositely charged linear polyelectrolytes. For this purpose, we varied the nature of polyelectrolytes by considering both mono-and divalent chains and studied these cases for different valency of counterions. The dielectric properties of the solvent were also varied systematically. The counterions as well as solvent molecules were explicitly included in the model. It turned out that the complexation of a linear polyelectrolyte with a dendrimer leads to a remarkable condensation of the complex. Furthermore, formation of the complex gives rise to a considerable dehydration of the chain, the dehydration becoming more pronounced when the electrostatic interactions strengthen. Thus, charged dendrimers clearly demonstrate ability for efficient compaction of guest chains and protective screening of the chains from the surrounding medium, the two well-known prerequisites for vehicle-mediated delivery of drugs and genes into cells. In addition, our study indicates noticeable effects of counterions on the structure of dendrimer-chain complexes. These effects become more pronounced with increasing strength of electrostatic interactions.