is it possible to mask esn of a smartphone? On a computer, it's possible to trick a server that you are using a different computer by masking MAC address.

Is there something like that for android? 
Rooted phones have full access. So I'd think it should be possible.
I don't mean wi-fi mac address, I mean 4g/3g alternative to mac, I assume it's ESN.

If that is possible, than there is a security problem. Someone can pretend that they are using your phone. Of course, there is still Google account password but still, is this possible?
Since the nature of your question is simply "is this possible", the answer is yes, there are ways to spoof your ESN. Often this is a form of phone cloning, which is also simply referred to as ESN cloning. The concept is that you take one phone and then configure it to broadcast using the ESN of a different phone, effectively "cloning" the second as far as the network is concerned.

However, it's important to note that in most Western countries (and possibly elsewhere) doing this is illegal. In the US it is considered "cell phone fraud" or "subscriber fraud" and is covered on the FCC's website in some detail. I believe it's similar across much of Europe.