Originally I have written my code in atmega328 as the code only requires about 5kb and the atmega328 has 32kb I though it would be a waste of space and atmega 8 is way cheaper.
In my code I have a bunch of digitalWrite, analogRead and analogWrite and nothing special. But I have used a pwm frequency library.
My Question is: Is the pwm registers same in atmega8 as the atmega328
If you can understand the answers, you can learn to read a data sheet. The skills that you need to understand timer code, are almost the same as the skills you need to read a data sheet. So you need to start thinking more independently and adopting more academic engineering skills, or you are just "playing". That's fine in itself but if you ask for help, now people will wonder, "how much effort has this person really made on their own?".
Data sheets are usually very well organized, written, presented and indexed. A forum isn't. Often a library will provide documentation about which processors and platforms are supported. Look there too.
If you have any question about a data sheet, please post it here and I will gladly comment.
As I indicated, the documents are indexed, in the usual PDF file it can be opened on the left hand side, you can quickly navigate to "timers" in almost every case.