Can you restore a bad esn iPhone 4?

I bought an iphone 4 on ebay and wan to ask if i can still restore it or will it be brick?

You should have asked all that before you bought it.

It won't brick, but an ESN/IMED block has to be removed on the carriers end. Since you can't change the ESN, it will remain blocked no matter what you do to the phone. Most of the time a blocked ESN means the phone is a stolen phone or that the owner stopped paying their bills (if you don't pay an ETF they'll block your ESN). You should demand the seller take it back and refund you. If they refuse file a buyer protection complaint with eBay. It is against eBay policy to sell stolen or non-functional items, so you will get your money back.