Some might be based on real events. For example, the old jail's stories could have roots in the actual harsh conditions and tragedies that occurred there. However, over time, details may have been exaggerated.
It's hard to say for sure. The story of the mansion could be based on a real death that happened long ago. But as stories are passed down, they often get mixed with fictional elements. People's imaginations can also play a part in making the stories seem more 'ghostly' than they really are. The spooky feelings could be due to the old, dilapidated state of the buildings rather than actual ghosts.