Yes, it is safe, as a hospital cage, but I'm not sure it's the most practical for a trip to the vet.
To transport them to the vet, I'd suggest small animal baskets instead,
(like this one)
much more practical and less risky to fall and open during the trip.