One of the worst cases I've come across as a home inspector is walking into a house when I suddenly felt like I got hit in the forehead with a ballpien hammer. The amonia was so strong I could barely stand it. Obviously in this case I recommended replacing the carpeting and potentially the some of the subfloor as well.
One method employed to mitigate bad aromas in homes is ozone treatment. This method kills bacteria and mold spores that contribute to some of the nasty aromas that are found in homes. An ozone generator is very effective at removing these bad aromas.