I have a 13 Ford Focus with 215/50/17 tires(factory size) which need replacement soon. Could I safely replace them(all 4) with 215/45/17?
Yes, it's safe.
Decreased tire height will increase the odds of dinging your wheels when parking or running over curbs, etc., but as long as they fit correctly on your wheels (same rim diameter / tire width) and have a high enough load rating for your car, there's no reason they would be dangerous.
Yes it will fit safely, but will lower your vehicle by (0.50-0.45)*215mm = 10.75mm and will increase your speedometer and odometer reading by 2%.