Food that's only a few months past the expiration is generally safe for dogs.
While you may not touch a piece of expired food a day after it has expired, dogs can handle a lot more than humans can in terms of Food and digestion.
However, before feeding the dog this Food, check it for mold and bacteria.