It's not entirely an invention of Disney or Robert Louis Stevenson from Treasure Island. It wasn't particularly "common" but there are quite a few records of trained parrots and parakeets as well as other birds (aside from chickens and poultry that were extremely common) aboard ships during the age of sail and during the so-called Golden Age of Piracy from about 1660-1725.
Parrots are native to the Americas, Africa and Southeast Asia and after the 16th century Europeans became aware of them and that they could be trained and this made them into amusing pets and curiosities that could fetch a high price. Parrots during this time commonly sold for about five pieces of eight (The Buccaneer's Realm, Little, p. 18) which would be the equivalent of about $250 today. According to some reports, there was sometimes "an abundance of parrots" aboard certain ships that were taken to be sold at other ports, though reportedly they were also very hard to look after, each being "harder to maintain aboard ... than I have since done a wife and two children" (The Buccaneer's Realm, Little, p. 18). William Dampier writing in the late 17th century, among others, also recorded that sailors would often carry home monkeys, parrots and parakeets as pets or to be sold (The Sea Rover's Practice, Little, p. 208).
Parakeets were sometimes transported onboard ships during this time for sale as exotic pets as well. They could reportedly be bought from Africa for the price of 40 in a cage for a half dollar which would have been the equivalent of about $25 today (The Buccaneer's Realm, Little, p. 18).
Another bird related curiosity, mentioned in the book The Buccaneers of America published in 1678, is that Caribbean natives killed humming birds by shooting them with a wax-tipped arrow and then preserved them and sold them to Europeans (Exquemelin, p. 53). These would presumably have sometimes been transported on ships as well.
Lastly, sometimes wild birds like seagulls would land on ships while out at sea. Another such bird was the albatross. In one extremely famous instance, Simon Hatley, a crew member aboard George Shelvocke's privateering expedition in 1719, shot a black albatross that had been following their ship for three days around Cape Horn (Shelvocke, pp. 75-6). This event was the inspiration for Samuel Taylor Coleridge's famous poem The Rime of the Ancient Mariner in 1798.
I don't know of any records of specific pet parrots carried by specific people during this time but it's actually entirely plausible for a pirate to have a parrot as a pet, as they were fairly commonly traded pets in the tropics and the Caribbean throughout the age of sail.
Sources:
The Buccaneer's Realm: Pirate Life on the Spanish Maine, 1674-1688 by Bennerson Little
The Sea Rover's Practice: Pirate Tactics and Techniques, 1630-1730
The Buccaneers of America by Alexandre Exquemelin.
A Voyage Round The World by Way of the Great South Sea by George Shelvocke.