According to Insider, Stanford has a blanket policy that prevents the usage of the school’s name in commercial films and filming on campus. According to the policy, the university had such a rule in place due to “year-round campus activity” to protect “the privacy and safety of its students, faculty, and staff.”
While Harvard University also has a rule against commercial film shooting on its campus, plenty of movies and shows feature the university as its setting due to its flexibility with using the Harvard name, according to The Los Angeles Times.
According to The Worldwide Guide to Movie Locations, although Legally Blonde was set at Harvard University, campus scenes for the movie were filmed at the Rose City High School, University of Southern California, Los Angeles, California Institute of Technology, and the University of California.