Trailers are often being cut before the score is ready. Teasers for example could be released 12, or even 18 months ahead of time, i.e. before a score might even be under way (depending on the film, obviously)...
Some trailers can have musical IP from the film though, (my guess is it all depends on how the film is handling post production..) Dune for example clearly had the music underway before any trailers were released, (more about that below), If you look at the trailers you can hear various parts of the score used.
The 1st trailer used the opening percussion hook from the film at :30. (Pretty sure there's other stuff used within the 1st minute or so).
The second trailer has tons of musical IP from the score.
Mark Petrie actually posted about customizing music for the final trailer on LinkedIn:
I still have to pinch myself writing this, but over a couple of weeks in June I had the privilege and joy of working directly with Hans Zimmer and his team on… | 33 comments on LinkedIn
www.linkedin.com
Here's his original track:
There is an art to trailer music though. Telling a cohesive & compelling story in 3 mins isn't as easy as it sounds... There's
great interview with two of the guys from Hi Finesse where they talk about how writing for trailers is a skill that some film composers just aren't able to pick up. (Great interview, anyone interested in the topic of this thread should watch it...) Someone posted a quote last month that's totally on point - "Trailer music's easy, until you write it."
So the 'specialty music' aspect is a huge factor, but the other side of the coin is that the music if often not completed when they start marketing a film...