If you’re considering changing your mind and rescinding a job offer, you probably should – whether or not it has been accepted. The cost of doing so will vary depending upon the circumstances and should impact your decision. But all plans are final until they change. So shame on you if you don’t change your hiring plan based on new information about the person you’re hiring or changing circumstances.
Do what’s right and do it in the right way. Yes you can change your mind. No you can’t break the law and should not do anything unethical. Yes you can break a contract. And yes, there will be a cost to that. Just weigh the costs of breaking the contract against the total system costs of going forward with the wrong hire or the right hire in the wrong circumstances.