Well, in my opinion, you can use sunglasses as safety glasses, and they can shield your eyes too. First, you should know that the sun emits three types of rays, which are visible, infrared and ultraviolet (UV). And according to some researches, the invisible UV light is the component of sunlight most responsible for eye damage. And when you do not use sunglasses to protect your eyes, when you go outsides, it is possible to have permanent sun damage on your eyes. Also blindness and eye cancer may occur too. So you can try sunglasses which are polarized to protect your eyes.
It depends on which condition you are going to be. In general, safety glasses can't be replaced by safety glasses. For example, if you do some work like weld. You shall wear safety glasses or masks to protect your eyes. You know, when you weld, it will create some flash fire, which may damages your eyes and faces. In this situation, sunglasses won't provide your well protection. So, you shall wear special safety glasses when you do some dangerous work. And sunglasses are also worn for shield eyes from UV light.