Can click consonants arise from non-click consonants?Or are they an original feature of all languages that was lost in the majority of them and only retained in few?
There is no known case where click consonants developed by regular sound change from some type of non-click. One can speculate that it could happen from extreme velarization of a language consonant, where the back tongue stricture in [tˠ] becomes a complete closure. In the case of the Khoisan languages, we have no idea where the clicks came from. Indeed, despite the implication of the name, Khoisan is not a demonstrated language family and the various sub-groups of Khoisan may not be genetically related at all.
We do know that the various Bantu languages of southern Africa plus Cushitic Dahalo of Kenya have borrowed clicks via contact with languages that have clicks. Once clicks are in the inventory, they can be freely used as sounds of the language. In quite a number of cultures (including English-speaking), clicks are used as bare noises for various expressive purposes, such as "tsk!" as the ideophone of disapproval. Clicks are also employed in Damin, which is a now-extinct ritual language used by Lardil speakers. As described by Hale & Nash in "Damin and Lardil phonotactics", the Damin clicks (which are nasal) do not contrast with non-click nasals. Damin is not a regular genetically-transmitted language (was not learned by children picking up the surrounding language).