Q:

If hard disk is as fast as RAM, can it replace RAM

If hard disk is as fast as RAM in a computer, then can it replace RAM itself?  If not what are the reasons behind? 

A:

Off-topic - and my close vote is in, but my comment kept growing so I added it below. 

Of course - ignoring other issues like integration (eg.  CPU being able to directly access the "HDD RAM") and assuming "as fast as" covers all the different factors including latency, throughout, and consistency and there are no issues with durability, etc.  In which case the answer is self-evident: a better X is a better X.
However, this is not even close to being the case and both distinct types of hardware are designed with different goals in mind and use different technology to achieve it. 
For starters, even the fastest SSDs are still more than an order of magnitude slower than RAM.  
Even within this general rule, many different aspects of "speed" must be taken into account - just because the throughput of a SSD might be 1/10th of memory doesn't mean it supports continuous random-access anywhere close to that of standard main memory!  Storage devices are also generally always accessed in blocks - eg.  4k - which further makes them unsuitable to "replace" RAM without extreme integration re-designs. 
RAM changes alot and it must do so very quickly and consistently so the CPU can run efficiently (even having to use the RAM over the much quicker L-cache can slow down a CPU a lot) - there is no room for a "GC pause" or full cache.  On the other hand, storage devices have the property of being non-volatile.  RAM can be much faster in part because it is volatile and doesn't have this property/restriction. 
Now, what a fast storage device can and does do is it makes Memory Paging / Swap usage significantly faster than it has been historically - this supplements RAM (possibly allowing a system to achieve the same performance with less main memory), but is not used to "replace" RAM outright. 
Using storage for memory swap space has been done for decades now - and your current [desktop] operating system is already doing it for you!  The idea is that memory not accessed can be tucked away on a much slower, but cheaper and more available storage until it needs to be used.  When it is used it is moved back to the much faster RAM. 
See Why not use SSD space as RAM?,   and elsewhere.