Human speech (including dialogue in movies) has a certain pitch.
Well, this is true MOST of the time. As counterexamples, whispers wouldn't have defined pitch, and neither would certain other ways to vocalize dialogue (vocal fry in a delivery tends to obscure the fundamental, for example). Breathing sounds like sighs don't have strong observable fundamentals. But I'll answer this recognizing that those types of speech dialogue are a minority of lines spoken in film and have no impact on the premise of the question:
My initial thought is that this would make little sense. For one, (and I am not experienced with the film industry, but) if I were in charge of a movie, I might possibly even have written the score to match the scenes before filming them, and that would in this case end up putting the responsibility on either the dialogue team to write dialogue that also corresponds with the score, or else on the actors to deliver their lines in accordance with the score.
But either way you slice it, you're either asking composers to account for actors' random speech pitch in their music or you're asking actors to learn to deliver lines in musically-dictated ways. Both options force the two teams to work together in ways that would have little to no precedent, and that sounds like a good reason not to do this to me.
Also, what effect would this have on the scene anyway? It seems to me like this would even have some potential downsides - the notes of speech could even blend into the score too well and make it harder to understand. And this would also be a very unnatural way to hear dialogue.
What other audio-visual medium matches up music to dialogue? If you've ever seen videos of someone like Charles Cornell adding piano harmonization to a video clip of someone talking, you may have noticed that the music added is fairly involved - it can't sit still in one key, since the speech frequencies won't naturally stay in one scale pattern for very long. Or if the actors were matching the score, it seems to me like it would be very clumsy for them to try to hit specific target frequencies while delivering lines in a realistic manner. I mean, what, would they be autotuned or something? And either way, dialogue matching music is not normally a subtle effect. Audiences will notice this, and that could take them out of the scene and spoil the sense of immersion in the narrative.
Execution would also be a massive problem. Composing around seemingly random notes would be a very tough task, and if the music is being performed and recorded to match the scenes, then oh boy, you better have a good conductor to lead the orchestra through the freely human timing of dialogue. If it's the actors with the tough job, remember that not all actors would have extensive musical ability. This could reduce the potential pool of acting talent significantly since there would probably be some musical ability required for them to deliver lines at the correct pitches - imagine delivering a monologue while syncing up to a piece of music? How will the studio find workers who are willing to even attempt such an unproven novelty concept as this? Editing also seems like a nightmare and a half - pitch editing could help, but it changes the timbre of the voice (and putting an entire movie's worth of dialogue through music production technology sounds atrocious). The logistics of this undertaking are quite intimidating.
Why not have the actors sing instead, like in musical theatre? Or take more inspiration from opera, where this is an established thing for the genre? In those cases, there is plenty of precedent for the actors and composers to be tied together. Simply trying to play off as coincidental the intentional correspondence between music and speech just seems like such an awkward idea to me - it shouldn't stick out too much, but it's a noticeable effect that takes lots of planning and coordination; it should seem natural, but it's a phenomenon that never occurs extensively in the wild; it should heighten the experience of the scene, but it risks disrupting suspension of belief. Contradictions abound!
And consider this: human audiences are used to actors' dialogue not matching up with music. In fact, there's probably some psychology behind the reason why audiences perceive pitch in singing but tend to ignore it in voice-over. Here's an exercise if anyone wants to prove this to themselves:
Take a movie that you know really well, and look at a transcript of the dialogue of that movie. Find a line from that movie in the transcript that is delivered underneath a song, and then listen to just that background song without the dialogue line in it. While listening to the song, take a guess at the pitch of the movie line from memory. Record that guess or write it down, then go listen to the actual scene. Did you guess exactly what note the line begins on? More than likely, you were wrong. You may have been in the ballpark, but odds are you weren't very confident about the exact note the line begins on.
Run this experiment again, but this time instead of a dialogue line, do it with a lyric from a song (find an instrumental of the song this time so you can guess at arbitrary pitches). This time, assuming you're confident in your ability to carry a tune, you probably got it right (give or take an octave or two)!
If you're stuck struggling to think of a good example for the experiment, here's an example/suggestion: what's the highest note that Mark Hamill hits during his scream from Star Wars: The Empire Strikes Back? (Note that the video clip below ends a few seconds before the scream itself, but not before it establishes D minor very clearly as the key for reference). The scream is "Nooooooooooooooooo, noooooooo...":
Now try guessing the first sung note of this verse from "Bohemian Rhapsody" by Queen (the lyric is "Mama, just killed a man" and the key is Bb major) based off of this instrumental:
Here's the example answers, if you want to check to see if you got it right:
The Empire Strikes Back scream peaks out at a B natural(!), then slides downwards.
The Bohemian Rhapsody first note is a D natural.
To sum up, I believe that if this effect were ever to be used in film, it would be for a very small-scope usage. Maybe a scream lines up with the underlying chord. Maybe the roar of the crowd sets a specific pitch, and then the background music uses that pedal tone. But for entire scenes to be built around this gimmick, there are a lot of obstacles in the way and there are a lot of alternatives that look much more appealing. Fun question to explore, but in my opinion a long ways away from a reality in today's world.