Yes, it is legal. In the first place, employers are allowed to put terms and conditions on the use of paid time off or the provision of unpaid days off, so they could require a doctor's note (or similar documentary evidence) for alleged doctor's visits/time off for medical care. Similarly, they can also require validation or proof of the reason for a requested schedule change. In the second place, even if there is no general policy like the above, employers are allowed to verify an employee's claims or statements if the employer is suspicious of them for some reason--and to terminate someone if they lied about the reson they needed a day off or a schedule change.