You should never install new flooring over a subfloor that has pet stains and odors. Those stains and smells can't simply be covered up and forgotten -- eventually they seep through your new flooring and permeate your new or remodeled home. Depending on the age of the stains and odors, you have multiple options for dealing with them so you can install your new flooring without worrying about a future visit from old smells.
Blot the pet stain with a cloth if it is a recent accident. Do not spread the stain around the floor -- just soak up any excess liquid.
Pour a small amount of white distilled vinegar directly over the stain and allow it to sit for about a minute or two. This will help neutralize the odor. Wipe the vinegar off the floor.
Spray an enzymatic stain remover directly onto the stain. These are available at most pet supply stores and many big box department stores. These cleaners are meant to be left on the stain for four to eight hours, but this varies by product. Read all manufacturer's instructions before using a product.
Pour hydrogen peroxide over older, stubborn stains. Spread the peroxide so the entire stain is covered, then tape plastic wrap down over the peroxide. Allow the peroxide to sit overnight, then check the stain the following day.
Repeat this process until the stains and odors disappear. Wipe up the peroxide and allow the subfloor to dry completely before attempting to install new flooring.