No, you could not. A contingency is a clause you put in an offer that will allow you out of the contract if the situation covered in the clause happens or doesn't happen. Mortgage contingency - buyer is denied mortgage, buyer is out of contract; sale contingency - buyer must sell existing property, seller receives a better offer, buyer fails to remove contingency, seller is out of contract.
If you had put a contingency clause in the contract that said if the current tenant moved out or was evicted before closing, you could exit the contract, then you could. NO seller would ever agree to that in a contract. If there is no one in the rental unit when you take over, you can find your own tenant. The contract should already address tenant damage and any potential legal issues. You can't get out of buying the property over this. You MAY be able to delay the closing until the eviction is enforced and the tenant is out.