Yes.
Legitimate taxis and ride shares are perfectly safe.
Always remember to check the validity and credentials of each driver before entering the vehicle.
Follow all the safety guidelines provided by the company.