I used to do this all the time, until a Walmart employee said somethng to me.
I used to just try a small bit on a fingernail to see if I liked the color, usually trying to decide between two to three different shades of one color, say pink for example.
The employee asked me to please not do that and explained that people could have a nail fungus that could be contagious, whether I did or not, the person before me who might have done the same thing, could have passed that fungus on to me.
Honestly, I just never had a clue about this. I have not tried nail polish in the store since.
(But, it makes you wonder. What if someone did have a fungus and did try it on before me? Yet, I still have now bought that nail polish.)
So far, I have never had any problems. I now usually only buy OPI because I have found that it is actually worth the price, applies well and stays on well.