The pilot episode of Gilmore Girls was filmed in Canada, chiefly in Unionville, Ontario.
Unionville, a historic community near Toronto, stood in for the fictional Connecticut town of Stars Hollow. Its small-town streets, older storefronts, and distinctive architecture provided the visual foundation for the pilot’s setting. Several recognizable locations, including buildings used for the diner and town-center scenes, were adapted to resemble the show’s fictional world.
After the pilot was approved, production moved to California. The regular series was filmed primarily on the Warner Bros. studio lot in Burbank, where a permanent Stars Hollow backlot was constructed. That change explains why some locations and building exteriors look different when viewers compare the pilot with later episodes.
The answer refers specifically to the pilot, not the entire series. Saying that Gilmore Girls was filmed in Canada is therefore an understandable but incomplete claim: Canada provided the pilot’s principal setting, while the long-running production was based in California.