You need to go back and see if the smell is a dog smell or urine contamination, i would deal with both in a different way. Dog smells are caused by the bacteria that live in the dogs coat, i would tackle this on a nylon carpet with high PH products to make sure you break down all the grease and high heat to kill the bacteria, if you use a porty put red hot water in the tank and also use the heater if you have one.
If its urine you need a neutrelizer, in this case put plenty down, if the problem in either case is really bad then the underlay could do with replacing, saying that it might be cheaper just to replace the whole lot.
Mark