The buzz of anticipation surrounding ''Twin Peaks,'' the rhapsodic murder mystery that will have its premiere tonight at 9 on ABC, can be largely traced to David Lynch, a film maker of renowned strangeness who will be making his commercial TV debut with this two-hour pilot. (The first hourlong episode of the seven-part series begins Thursday night at 9.) The thought that the writer-director of the art-house horror film ''Eraserhead'' and the more widely shown, if comparably twisted, ''Blue Velvet'' has been granted network financing and let loose in prime time is provoking wicked smiles among Mr. Lynch's loyal following. Many of them may tune in just to see how much of his surreal sensibility, which is partial to gore and violent comedy, will survive the ABC censors.

Mr. Lynch's odd star appeal, however, does not explain what he is doing on television. The broadcasting of his work to network millions and any success the series may enjoy, with either critics or viewers, is due in no small part to Mark Frost, a former writer for ''Hill Street Blues'' and the co-producer with Mr. Lynch, as well as a co-writer and co-director, of ''Twin Peaks.'' It is doubtful whether ABC would have gone for one partner without the other.

''We liked the idea of pairing David with Mark, who has experience in television,'' says Gary Levine, vice president for dramatic series development at ABC. The sleepwalk pace of Mr. Lynch's theatrical films, as much as the nightmare charge they carry, makes them unsuitable for most commercial broadcasts. ''From his work on 'Hill Street Blues,' Mark understands how to work within an extended story with lots of characters,'' says Mr. Levine. ''We're hoping to attract both Lynch devotees and soap-opera fans.''

''Twin Peaks'' is the first fruitful collaboration between the 44-year-old Mr. Lynch and the 36-year-old Mr. Frost after several unfinished efforts. They met in 1986 when they co-wrote a film script for ''Goddess,'' a fictionalized account of Marilyn Monroe's last years, which was never produced. They also teamed up as writer (Mr. Frost) and director (Mr. Lynch) on ''One Saliva Bubble,'' a comic feature that was scheduled to star Steve Martin and Martin Short. But like many of Mr. Lynch's projects after ''Blue Velvet,'' this script has remained tied up in the bankruptcy of the producer Dino De Laurentiis.