Don’t forget that marketing may start on a film long before a final print is finished for theatrical distribution. Often times, editors will have access to ALL of the footage when cutting a trailer, sometimes just specific sequences. It’s a collaborative effort where they approve whatever is used, but this is why alternate takes or even jokes are used in trailers. Because at the time, there may not have been a final one created.
Trailers tell the story of a film in a highly condensed fashion that
must have maximum appeal. In the decades since film marketing has
become a large industry, trailers have become highly polished pieces
of advertising, able to present even poor movies in an attractive
light. Some of the elements common to many trailers are listed below.
Trailers are typically made up of scenes from the film they are
promoting, but sometimes contain deleted scenes from the film.
Most trailers have a three-act structure similar to a full
feature-length film. They start with a beginning (act 1) that lays out
the premise of the story. The middle (act 2) drives the story further
and usually ends with a dramatic climax. Act 3 usually features a
strong piece of "signature music" (either a recognizable song or a
powerful, sweeping orchestral piece). This last act often consists of
a visual montage of powerful and emotional moments of the film and may
also contain a cast run if there are noteworthy stars that could help
sell the movie.
Some trailers use "special shoot" footage, which is material that has
been created specifically for advertising purposes and does not appear
in the actual film. The most notable film to use this technique was
Terminator 2: Judgment Day, whose trailer featured an elaborate
special effect scene of a T-800 Terminator being assembled in a
factory that was never intended to be in the film itself.
So this may be the same for the case of The Amazing Spider-man or The Dark Knight Rises's trailer which contains some deleted scene.