Yes, would be the short answer.
It depends is a truer answer.
1 - will the bios need to be flashed to accept the 40GB?
2 - are there any special boot sectors on the current disk that you will need? Some PCs and laptops, have special instructions written into the hdd.
3 - does the manufacturer give any guidelines?