I mailed my mortgage payment before the due date. But the bank received it one day after the due date, and I was charged a late fee. Can it do this?

Yes. You must mail your payment in sufficient time for the bank to receive it on or before the due date.

When considering timeliness of a payment, banks are not obligated to honor postmarked dates. In determining lateness, the bank goes by when the payment is received, not when it was mailed.