Can someone explain why, in certain regions of the U.S., speakers say, "I scraped the side of the car ON accident," instead of, "I scraped the side of the car BY accident."

Also, in certain regions, speakers say, "I stood ON line for hours in the rain," instead of what I would say, which is, "I stood IN line for hours in the rain."

After all, in the second case, there is no actual line on the ground, sidewalk, or street ON which to stand.

The first one doesn't make sense at all to me.

Is this just an example of regional dailect that isn't technically correct, or am I missing something here?
I am not from the US, but I don't think either one of those would be correct anywhere in the US. They may be regional dialects, but that doesn't make them correct. I agree with you: ... BY accident, ... IN line.
Thanks for that affirmation! I find both usages very odd.