Unless you have permission from the WiFi network owner to use the network, you are guilty of theft (of data from the owner's contract) and hacking (into the network).
Accessing, or even attempting to access a network, without the network owner's permission is illegal. It makes no difference if the network is open (unencrypted).
When you go to a coffee shop or similar place that offers 'free' WiFi, if you hang around outside to use their WiFi, then technically that is theft. You need to buy something, which will carry implied permission to use the network for that particular visit.
There is also the danger that your computer could be hacked, a virus or malware might infect it or the data you are passing across the WiFi network may be monitored.
No! It's definitely not safe to use a stranger's network. You should be careful when using any WiFi network that is unencrypted or is encrypted using the WEP algorithms. WPA, or better still WPA2, should be safe, providing you have permission.