My PC works well while booting from HDD but freezes at different instances each time when trying to boot from CD.

I tried changing CD Drive but the result is same. The bootable CD is also working well in other PC. Can it be corrupt BIOS or hardware fault?

Maybe a faulty cable?

Try changing the cable.

How old is your computer? Some older computers use an analog audio cable for the disk drives and I've noticed it will sometimes cause problems if not installed (this is only on IDE drives). If its a SATA, make sure you have it set up correctly in the BIOS.

Thanks for replay.

I have tried different cables as well.
My PC is 5 years old.
What is the analog audio cable???. I do have IDE drive (both CD and HD).

there is a small thin cable that goes from the Cd to the Motherboard for audio.

Have you set the Drive to cable select or Master /Slave? regardless try setting it to CS for both the hard drive and Cd-Rom

Now I have tried to boot from USB. still the same result. It means that the problem is not with disk drive cables.
I have some bad sectors started forming on HDD. could that be the reason for freeze?

Also note that though bad sectors HDD boots perfectly.

it is quite possible, but it depends on how many bad sectors we are talking about.

It could also mean that the source is corrupt.