Ooh, I can do this one! Pirates came from a variety of classes, walks of life, multiple countries and continents, so a common accent (or even language) is completely out of the question. That accent you're hearing is an exaggerated version of the one commonly associated with the English west country. But we associate it with pirates today because of two men. Sir Francis Drake, the famed English privateer, who hailed from Devonshire in that region, is one. But more importantly, an actor by the name of Robert Newton, who played Long John Silver in the 1950 version of Treasure Island (and several spinoff movies and a TV series) and Blackbeard in the 1952 Blackbeard the Pirate, invented the pirate accent as we know it, starting with his own Dorset accent and exaggerating for effect. Being pretty thoroughly typecast for years, Newton affected the way people think pirates talk the same way Errol Flynn affected how people think swordfights work.
Interestingly, between the book and various versions of the movie, Treasure Island is responsbile for most pop culture pirate lore. Long John had a parrot, was missing a leg (no peg leg in the book, but he did have it in some of the movies), so those became standard pirate accouterments.