As R_1 said, only as a secondary HDD. You can't boot the new machine from the old HDD because it won't have the motherboard/chipset/CPU drivers for the new build installed. Those drivers are installed when you install the OS.
When you build your new machine install a new HDD and do not install the old HDD. Complete your install and get it up and running and then install your old HDD to copy your data over. Be sure to use a lower numbered SATA port (SATA1) for the new HDD and install the old drive on a higher numbered SATA port (SATA2 or higher).
Of course that assumes your old drive is an SATA HDD. If it's an older IDE HDD you might have a hard time finding a motherboard with an IDE port. Even if you do, still do your install...