It depends on the type of mortgage. It is customary for the borrower to pay closing cost for a purchase mortgage. However, it is also customary for closing costs to be included for the purpose of a refinance.
Some purchase loans do not require closing costs to be paid by the consumer. They can, in fact, be paid by the seller with seller assistance, Government grants, or non profit assistance.
Also, in todays market, there are new products that enable a customer to pay no closing costs for a refinance. You must know, that nothing is free in the mortgage market. If you choose a no closing cost refinance, your interest rate will will increase.