L298N ground potential difference fried arduino nano

The motor power supply may be faulty, and somehow connecting to the household neutral or Earth ground. Replace it with a battery pack for testing.

When two devices are connected to different AC circuits, there is always a possibility of ground loops, due to various fault conditions.