Can an executor take money from bank accounts of the dead person before the will is probated?

Only if taken with power of attorney prior to death or as a joint owner of the account (and surviving owner after death). Otherwise, the bank transaction is void as against the estate and the bank should be notified to collect the misappropriated funds from the person prematurely claiming powers that can only be appointed in probate court.