It is ok to compliment strangers.
I like to compliment mothers (esp those struggling with their kids at the store) whenever I do my grocery shopping. It is nice to see their tired face brightens up when I call them beautiful. I think I did their husbands a favor too. :P