If you search on the internet you will find all kinds of videos and products that promise to permanantly clean and remove pet urine and odors from your rugs and carpets.
Do they actually work? The short answer is, "It depends". It all depends on things like what your rug is made of, what your dog's diet is, what kind of cleaning solutions you are using, the dyes in the rug, etc., etc., etc.
Sometimes you get lucky and the "do it yourself" remedy you chose worked. But quite often people find what they did failed or EVEN WORSE damaged their rug.
So unless you know what you are doing a professional rug cleaner is the best one to know how to get rid of dog urine smell and stains.