While both "by accident" and "on accident" are used, "by accident" is far more common.