Cameron Diaz's father was on set during filming, so the Farrellys decided to throw him in the movie. In the scene where Ben Stiller is released from prison after being wrongfully accused of murder, Cameron's dad is the inmate in the front with a beard and long hair jeering at Ben.
Docky and his wife are played by the Farrellys' parents. Docky is their dad's nickname.
Recycled Script: The dialogue between Mary and Ted about how there aren't enough meats on sticks was originally written for an episode of Seinfeld that never aired. The Farrelly Brothers liked it and bought it for use in the movie.
The film's original ending had Ted getting hit by a bus right after Mary chooses him over her other suitors (basically turning the film into a Shoot the Shaggy Dog story). The Farrelly Brothers decided this would be too dark of a way to end the film, so they went with a more traditional happy ending.