"Legally Blonde" was not actually shot at the Harvard campus in Cambridge, Massachusetts. Per Movie-Locations.com, "a few establishing shots" of Harvard Square were the only footage in the movie that was actually shot on location.
Otherwise, scenes set at Harvard were, by and large, shot in Los Angeles, California, and its surrounding area. Rose City High School in Pasadena was used for indoor hallway and classroom scenes, and the rectory of All Saints Church in the same city stood in for the gothic Harvard square. Other scenes around the Harvard campus were shot at UCLA and USC (via Los Angeles Magazine).
The fictional college where Elle is studying fashion merchandising at the beginning of the movie was originally supposed to be USC in the movie itself, but the university didn't grant permission for its name to be used, as noted by the Los Angeles Times. Hence Elle being a "CULA" pupil in the film; early scenes at the made-up college, including the opening at Elle's sorority house, were shot at the CalTech campus.