The 81-year-old actor guest hosted the long-running news quiz show last month, when he joked that Ilfracombe was full of prostitutes.
After he mispronounced the name of the town, panellist Charlie Brooker said that he had made it sound "deeply sexual".
Shatner replied by saying: "The place is laced with prostitution."
Former Mayor of Ilfracombe Paul Crabb sent a letter to Shatner inviting him to come to the town to prove that there are no prostitutes in the area.
Crabb wrote to Shatner's agent: "As Captain James T Kirk, Mr Shatner has been to places where no man has gone before, however, the episode of Have I Got News For You clearly shows he has never been to Ilfracombe.
"If he came, we could show him that there is no prostitution in Ilfracombe and that it is a lovely coastal town with spectacular scenery and a close community."
The Star Trek legend replied by saying that prostitution "commonly means sex for something of value".
He added: "I would be hard pressed to believe that sex was not being had in Ilfracombe for something of value, perhaps a lengthy marriage, children or a valuable career.
"In any event, my apologies for having singled out Ilfracombe as a potential haven for prostitution. With you overseeing, I am sure that will not happen."
Paul Crabb told BBC News: "We are a fairly good natured bunch down here.
"I'm sure the vast majority of people took it as tongue in cheek humour, but there were some who were upset.
"Maybe he has gone some way to assuage their concerns."