This is a buoyancy problem and is solved through naval architecture. Here are the key concepts:
The center of gravity is the center of mass on the ship. The ship is pulled downwards as if it were a point mass at this point. The center of buoyancy is 'point source' of the buoyancy. These are two forces acting on a ship. When the ship is upright (the picture to the left, above) these two forces cancel each other out.
When the ship rolls to one side or another they are out of balance. If you look at the picture to the right, above, the center of buoyancy is to the left of the center of gravity. That means these two forces will cause the ship to 'twist' in a counter-clockwise direction. This will cause the ship to right itself--this is called righting moment.
In this picture above, the righting arm is positive; that is the righting moment acts in the direction that will right the ship. It is possible, however, to have a negative righting arm. In that case, G will be to the right of Z (and B) in the above picture, and the ship will flip.
The last concept that is important is the metacenter (M in the above diagrams). As the ship rolls from left to right, the center of buoyancy will rotate around the axis of the metacenter. The metacentric height is the (constant) distance between G and M.
If you mount a heavy dragon on the deck, then this move the center of gravity towards the deck of the ship. As G moves upwards, if it ever raises past M then the ship becomes unstable, as any perturbation will move G to the right of B and flip the ship.
What happens to a small ship?
If your your pirate is master of a galley crew (or fleet), then he is likely going to be out of luck as far as landing a dragon. Here is a diagram of a trireme, based on what the Greeks would have used at Salamis. This is a ~50 ton vessel, with a crew of 100-200. Venetian galleys of the 14th century were not much bigger; warships were perhaps 100 tons and merchant galleys up to 300.
For this ship, the buoyant force is 50 tons (same as ship's displacement) and metacentric height is only about one meter. When the ship heels over 20 degrees, the righting moment is the buoyancy times the righting arm; which is
$$ GM \cdot \sin(\theta_r)$$ for shallow angles of $\theta_r$, or roll angle. GM is the metacentric height. Righting arm in this case is about 35 cm. The righting moment is then about 175 kN-m. This is the force that buoyancy puts on the boat to counteract wind and wave and keep you from tipping.
If a dragon is about 14,000 kg, and is two meters above the center of gravity, this changes the center of gravity upwards by roughly 0.4 meters relative to the metacenter. This has a linear reduction of righting arm down to 100 kN-m. This is a pretty solid hit on the stability; almost a 50% drop. Triremes did flip in storms; now they take about half the force to flip with the dragon on board.
How big should the ship be?
The ship should be much larger than the dragon. How much larger depends on the design of the ship. Where the trireme is a long, low ship, with only 2 meters of freeboard (height of the deck above the water level). This is the same freeboard as the reconstructed Nina (of Columbus fame) had at only 40 tons. A larger sailing ship would have a greater height out of the water, therefore a dragon posses a proportionately larger problem.
I would estimate that for a galley-stype ship, you would want at least a 200 ton vessel to safely park a dragon. On a full masted, Pirates of the Carribean stype sailing ship, you probably want more like 500 tons. This isn't that big in the scheme of things, but it is significantly larger than Queen Anne's Revenge (Blackbeard's ship). It is, however, much smaller than USS Constitution at 2200 tons. So, your pirate is going to need a relatively large ship.
On the other hand, the dragon can do a lot to help. First, the dragon has to keep its center of gravity in the center of the boat (just like you have to be careful in a canoe). Second, it would be really nice if the dragon left whenever the wind and waves go high. The danger of flipping is pretty small in calm seas.