Recently we investigated from first-principles screening properties in systems where small molecules, characterized by a finite electronic dipole moment, are encapsulated in different nanocages. The most relevant result was the observation of an antiscreening effect in alkali-halide nanocages characterized by ionic bonds: in fact, due to the relative displacement of positive and negative ions, induced by the dipole moment of the encapsulated molecule, these cages act as dipole-field amplifiers, different from what is observed in carbon fullerene nanocages, which exhibit instead a pronounced screening effect. Here we extend the study to another class of nanostructures: the nanotubes. Using first-principles techniques based on density functional theory, we studied the properties of endohedral nanotubes obtained by encapsulation of a water molecule or a linear HF molecule. A detailed analysis of the effective dipole moment of the complexes and of the electronic charge distribution suggests that screening effects crucially depend not only on the nature of the intramolecular bonds but also on the size and the shape of the nanotubes and on the specific encapsulated molecule. As observed in endohedral nanocages, screening is maximum in covalent-bond carbon nanotubes, while it is reduced in partially ionic nanotubes, and an antiscreening effect is observed in some ionic nanotubes. However, in this case, the scenario is more complex than in corresponding ionic nanocages. In fact the specific geometric structure of alkali-halide nanotubes turns out to be crucial for determining the screening/antiscreening behavior: while nanotubes with octagonal transversal section can exhibit an antiscreening effect, which quantitatively depends on the number of layers in the longitudinal direction, instead nanotubes with dodecagonal section are always characterized by a reduction of the total dipole moment so that a screening behavior is observed. Our results show that, even in nanotube structures, in principle one can tune the dipole moment and generate electrostatic fields at the nanoscale without the aid of external potentials.