Yes, they do film ghost stories at genuinely haunted (and scary) places. It’s happened many times.
The 1963 movie, The Haunting, used the Ettington Park Hotel in Stratford-upon-Avon (England). It’s supposed to be delightfully haunted. The hotel is elegant and reminiscent of the famous movie.
Trivia: That movie’s original — and perhaps haunted — spiral staircase reappeared in the 1999 remake of The Haunting, too.
Another old movie, Hush, Hush, Sweet Charlotte, wasn’t exactly a ghost story, but it was chilling. They filmed it at Houmas House, one of Louisiana’s most haunted houses. (I’ve spent the night there and can verify that it has ghosts that appear, day and night.)
Not far away, several movies were set in St. Louis Cemetery No. 1, at the edge of New Orleans’ French Quarter. They include Easy Rider and Cincinnati Kid. Producers filmed Interview with the Vampire at other haunted New Orleans locations.
The Hollywood movie set for the original movie, Psycho, was supposed to be haunted. I’m not sure if paranormal encounters happened before, during, or after the initial filming. At night, people were visible near upstairs windows… when there was no floor to walk on, and no possibility of a light near the window, either.
Those may be urban legends, but I heard enough first-person stories to think they might be true.
Session 9 was filmed at Danvers State Hospital, Danvers, MA (USA). The former hospital and the town of Danvers have many ghost stories, often overshadowed by nearby Salem.
The haunted Yankee Pedlar Inn in Torrington, CT (USA) inspired — and later became a set for — The Innkeepers.
I’m sure you’ll find many other movies listed, online. Look for “movies filmed at haunted places.”