My understanding is that as long as the exchange has not happened then you can pull out - but there may be costs involved.
This is for England and NI - Scotland has its on rules.
Until contracts are exchanged you can walk away at any time from sale/purchase.
Once contracts are exchanged then costs of pulling out would be significant.