Is it safe to cook and eat a 2 year old frozen pecan pie?

No, it is not safe to cook and eat a 2 year old frozen pecan pie.

While commercially sold pecan pies may have the benefit of extra preservatives the 2 year time span is enough time for other forms of contamination to potentially affect the pie without showing visible signs (e.g.: mold.) This could potentially cause food poisoning.

When in doubt, always best to discard rather than eat.