Can I use Time Machine to restore MacBook Pro after replacing hard drive? I am about to replace the hard drive in my MBP.  What I would like to ask is once I have replaced the drive can I use Time Machine to restore it back to how it was?  I have no other way to back it up.

OS X El Capitan
MBP 13" Mid 2012
2.5GHz i5
4GB 1600Mhz DDR3
Yes, I just did the same myself last week, though I'd recommend using a cloner (like Carbon Copy Cloner). 

If you are using a Time Machine backup, it would be better to install the operating system onto the drive, run all updates, then use Migration Assistant to bring all your stuff across, effectively a 'clean' install.