Although pinned pieces usually cannot move safely, there are key tactical moments when breaking the pin becomes the winning idea. A pinned piece can move if doing so creates a stronger threat than the consequence of the pin—for example: delivering check, capturing an important piece, creating a decisive attack, or setting up a tactical sequence like a fork, discovered attack, or zwischenzug. In these cases, the temporary loss or exposure caused by moving the pinned piece is outweighed by the tactical gain.
Example:


White has no choice but to take Black's queen 2.Bxd8 now Black uses his bishop to check the king: 2...Bb4!+ White has to play 3.Qd2

Black simply takes the queen: 3...Bxd2+ 4.Kxd2 and takes White's bishop 4...Kxd8

When the dust has settled, White realized that he was down a piece for just a pawn! As you see, this is one of the downsides of a Relative Pin - it's legal to move the pinned piece!