Yes, Greek drama originated in religious festivals honoring Dionysus, the god of wine, fertility, and theater. The word "tragedy" itself comes from the Greek tragōidia ("goat song"), possibly referring to a goat sacrificed or awarded as a prize.
During the Dionysia, choruses sang hymns (dithyrambs) and performed dances. Over time, a single actor (Thespis, traditionally) stepped out from the chorus to engage in dialogue, creating the first dramatic performances. This evolved into the structured tragedies and comedies of the Classical period (5th century BCE), performed in purpose-built theaters like the Theatre of Dionysus in Athens.
So while goats were part of the ritual context, the key development was the transformation of choral ritual into enacted drama with characters and plot.