Why has no country conquered or colonized Nepal? Nepal lost the Anglo-Nepalese War with East India Company but was not colonized.
There were some times Nepal was partially conquered.
Most were during the early medieval period. Documentation during this period can be problematic, but there are records of the Muraya Empire claiming the southern part of the country in the 3rd Century BCE, the Chalukya's managing to get Hindus installed as kings in the 6th CE, and the Tibetian Empire ruling large parts of the area in the late 8th.
In general, if a country is not invaded, it means that there are no resources worth having that are deemed worth the trouble it would be to take over. The particular war you mentioned with the British is a good example of the principle.
The BEI had started to lose money on their Indian empire once the price for its cotton exports dropped. Nepal's (at the time) western provinces were thought to produce some of the world's highest-quality wool, so the British invaded to take them. They largely succeeded, which is why those provinces to this day are part of India rather than Nepal (to be fair, the Nepalese had only controlled those provinces for about a generation).
They didn't bother taking the rest of Nepal because the western provinces were already very expensive to take, and they had no use for the rest of Nepal.