Sometimes. A deposit is 'non-refundable' if it's reasonable at the time of the contract was signed. In California law this concept is called 'liquidated damages'. Parties to a written contract can agree in writing what is going to be the 'penalty' for a party to break the agreement.