Extremely safe - just be careful about where your feet are if you're next to them. More people than you'd think have lost or seriously injured a foot because a cow or, especially, a draft horse, can't see where they're stepping.
If you get a chance and it's just cows then go up and say hi, they're wonderful animals and unbelievaby chill. I'd honestly be more comfortable petting a strange cow then a strange cat... if they shy away or noticeably get irritated when you approach be smart and give them space, but you're probably just going to get licked and mooed at.