Yes and maybe
can occur at the time of and immediately after an electric shock
Usually. That would be transient. As to whether a shock can cause ongoing arrhythmia that is harder to answer. Palpitations, unexplained, are so common that it would be hard to prove that the rhythm problem was caused by the shock. So i doubt the relation between electric shock and chronic arrhythmia.