If the inspection is not satisfactory, can the buyer back out of the deal?

In addition to everything else, the contract should include an "inspection contingency clause"; that is, what happens if the buyer's inspection does reveal problems with the property. What happens following the inspection depends on the terms of the contract. Small problems, like leaky faucets, loose light fixtures or doors that don't close properly can probably be fixed easily by the seller (i.e., solving the problem and basis for objection). More substantial problems, like a defective furnace, a waterlogged basement, or non-compliance with building codes, that can be structural, need more substantial repairs. Although, depending on the terms of the contract, the buyer can often break the deal without forfeiting his/her deposit, there may be a statement in the contract that says that the seller will either fix the problems, or give the buyer a discount on the price of the house in lieu of repairs. If the house is situated on a hillside, and is about to slide off the side of a cliff, the buyer will most likely want to cancel the contract.

See also http://real-estate-law.freeadvice.com/buy_sell_a_home/home_inspection.htm.