No, it is generally not safe to pet a deer. Deer are wild animals and can be unpredictable, potentially carrying diseases such as Lyme disease or Chronic Wasting Disease. They may act aggressively if threatened, especially when protecting fawns. In many areas, interacting with wild deer is also illegal.
What to Do Instead
Observe deer from a safe distance, do not feed them, and report injured or sick animals to local wildlife authorities.