In a word, no, but scientists can make educated guesses. The closest living relatives of dinosaur are crocodiles and birds, and we can pay attention to the way they vocalize to give us a clue.
Alligators and crocodiles use their larynxes to communicate—they hiss, moan, and yes, roar (here’s a compilation of what they make). Dinosaurs may have had larynxes, but since these don’t fossilize, it’s impossible to know for sure. Birds, on the other hand, use an organ called the syrinx that appears to have evolved after dinosaurs. That could indicate that dinos couldn’t vocalize at all, which would be a shame.
However, there is also a possibility that they have developed a unique way of vocalizing. For example, some have theorized this based on examination of their skulls and inner ears hadrosaurs used their crests to yell at each other.
So they probably didn’t yell, but yelling can be pretty cool too, right?