Fide Laws of chess for over the board play regarding touching pieces:
4.3
Except as provided in Article 4.2, if the player having the move deliberately touches on the chessboard
1. one or more of his own pieces, he must move the first piece touched that can be moved, or
2. one or more of his opponent`s pieces, he must capture the first piece touched, which can be captured, or
3. one piece of each colour, he must capture the opponent`s piece with his piece or, if this is illegal, move or capture the first piece touched which can be moved or captured. If it is unclear, whether the player`s own piece or his opponent`s was touched first, the player`s own piece shall be considered to have been touched before his opponent`s.
The word deliberately is the key part here. You dont have to move a piece or pawn if you accidently touch it.