The first Halloween episode of Once Upon a Time was the fifth episode of season 2 titled The Doctor. It was one of the darkest episodes of the whole show and had a profound impact on later installments. The episode itself first aired on the 28th of October 2012, just three days before Halloween. Although it isnt set at Halloween, it feels considerably darker than other episodes of the show. It shares aesthetics with other Halloween films, such as dark themes and colors, lots of lighting, and the first appearance of a zombie on the show. Once Upon a Time was definitely getting into the spooky spirit in a way that transformed the series.
https://screenrant.com/once-upon-a-time-halloween-episode-doctor-frankenstein-canon-change/