Most bacteria in cooked food is killed during the heating process which is why they recommend cooking food to 165 degrees. Pork is recommended to be cook to 170 degrees, or at least it used to be during my food service days. Most bacteria go dormant when frozen. As for spoiled food, if it was pasteurized you could still eat it if spoiled and you wouldn’t become ill as long as you can handle the taste (or chunks) as they case may be. You still have to be careful when consuming spoiled food because of the toxins (bacteria poop) or spores that will not be killed by high heat. Botulism would be an example of one that can develop is food is not properly canned.