Can they and will they are two different issues. Per the contract prior to delivery, both the dealer and the buyer can cancel the order. Typically a cash down payment is involved. If the dealer were to cancel, buyer gets the money back. If the buyer cancels BEFORE delivery, the contract I signed allowed me to get my money back. However, if I were to wait until the car shows up and ended up not signing the deal, down payment is kept by the dealer.
Now, a dealer will generally not cancel the order. It's a near 100% guaranteed deal that they have to expend little to no effort to close on. No dealer storage or lot fees. They typically unload it from the trailer, clean it up, then park it in the customer delivery area. If they cancel the deal, then they have to get that other person in there to buy it, car sits, buyer has no skin in the game at this point, so they may or may not actually buy the car. If not, then they're stuck with a potentially custom ordered vehicle that doesn't have the best options for their market and it ends up costing them time and lot fees to store and maintain. Honoring the contract results in a guaranteed sale. Bending to greed doesn't. That, and the negative press on Yelp! or Google reviews will hurt worse than the extra 1-2k they make on the other person.