You cannot build up a resistance to every water-borne disease.
Of the diseases you can build up an immunity to, there are more than one, and you have to build up immunity to each of them.
You can only build up immunity by exposure, often by getting sick and recovering, sometimes more than once.
The little bit of local water you drank is unlikely to have contained them all, and is unlikely to have been enough exposure to give you immunity to any.
The little bit of local water you drank may have even been nice clean water!
Some diseases are caused by viruses. (I'm not sure if any are common through bad tapwater.)
Some diseases are caused by bacteria.
Some diseases are caused by amoebas.
Some diseases are caused by chemicals, pollutants, or minerals, and have nothing to do with any kinds of "bugs".
Certain minerals such as arsenic and heavy metals will do more damage with prolonged exposure and will bioaccumulate in your body. This is also the case with nuclear radiation. This is quite the opposite of building up an immunity.
If any of this is scary, just drink bottled water all the time when travelling.
If you don't like to be paranoid, do what the guidebooks recommend for a particular location, or do as the locals do.
If you don't like to be ignorant, research the water quality in the specific places you're going to so you know which of the above you are dealing with.
If you're a survival type and know you're in a place where the only risk from the tap water is different intestinal flora than your own, then you can try getting used to the water.
By the way, our sister site, The Great Outdoors, has some very good questions on water safety. Oddly, they only have tags for water
and water purification
and not one for water safety.