It depends on the context. Pardon has multiple meanings, one of which is to "forgive" or "excuse". This is the definition used in simple expressions like "pardon me", or "I beg your pardon."
Another more formal definition of "pardon" is to be legally forgiven for some kind of crime by an official state agency. Usually a pardon is only issued after the person has been convicted of the crime. An official pardon means that the person pardoned is (eventually) cleared of any record of the criminal charge.
A pardon can be issued for various reasons, not always because the person is innocent:
A pardon is a government decision to allow a person who has been convicted of a crime to be free and absolved of that conviction, as if never convicted. Today, pardons are granted in many countries when individuals have demonstrated that they have fulfilled their debt to society, or are otherwise considered to be deserving.
Forgiveness is more generic. It's more often used to describe a personal decision to excuse someone for some kind of offense. As previously mentioned, you can also "pardon" them for that offense, but outside of certain "set" phrases, this use is not common in modern English.