Under ACH (automated clearing house) rules, when an electronically processed check is nsf, the nsf fee itself may be collected via electronic check.
Many large companies that process large volumes of checks (the power company, phone company, etc) will have disclosed this in a mailing to its customers.
If the check was given to a merchant (Wal-Mart, the local gas station or toy store, etc.), the notice that the merchant may collect an nsf fee in this manner should be posted at the register. If the notice is posted, and you still choose to pay by check - there's the agreement.