by accident / on accident
The preposition that goes with accident.
Use by accident. On accident borrows its preposition from on purpose. It is a casualism, and it does not belong in standard English.
Examples
Use The gardener pulled up the new seedlings by accident.
Avoid The gardener pulled up the new seedlings on accident. (Change on accident to by accident.)