First, it's not true that energies are generally in the form $\frac{a_1a_2^2}{2}$. Take the gravitational potential energy $U = \frac{GMm}{r}$ as an example. However, it is generally true that kinetic energy takes that quadratic form. Why?
Kinetic energy is the energy traded when some agent applies a force on some system that causes it (the system) to move, that is, to change its state in some fashion as time goes by. The agent is said to do work on the system and, so, the kinetic energy gained by the system is the work done by the force applied by the agent.
Note that I was very vague in the paragraph above about the nature of the force or of the motion of the system. I did that on purpose because I didn't want to refer exclusively to motion in space. There are other ways in which the state of a system could change with time. It doesn't have to be just a change in position.
Now, back to the definition of work. The gain in kinetic energy is given by
gain in KE = $\int_A^B \vec{F}(\vec{s}\,)\cdot d\vec{s}$
where $A$ and $B$ represent the initial and final states of the system, $\vec{F}$ is the force being applied, and $d\vec{s}$ is an infinitesimal displacement of the system. Again, $d\vec{s}$ does not need to be a displacement in position. You could have a meaningful definition of displacement for other properties of a system. For example, displacement (changes) in electric charge.
Likewise, you can have a meaningful definition of velocity that isn't related to motion in space. Velocity is really just the rate of change of something, most commonly position, but you could define other forms of velocity. So, the rate of change of the system's state displacement (for lack of a better term), the velocity associated with a displacement $d\vec{s}$, is just what you'd expect, $\vec{v} = d\vec{s}/dt$. An example in electromagnetism would be the electric current, the rate of change of accumulated charge, $i = \frac{dq}{dt}$.
Now let's try finding the gain in KE not in terms of displacement but in terms of time, by using $d\vec{s} = \vec{v}\,dt$. Then,
gain in KE = $\int_A^B \vec{F}(\vec{s}\,)\cdot\vec{v}\,dt$
Next, recall that $\vec{F}$ is the rate of change in the momentum of the system, $\vec{F} = \frac{d\vec{p}}{dt}$. Wait... isn't that assuming motion in space? Not necessarily. Some systems do have a meaningful definition of momentum that have nothing to do with moving in space. An electromagnetic example is inductance times current, $L\,i$, in a solenoid. And this looks a lot like $\vec{p} = m\,\vec{v}$, no? (except for the vector nature, or lack thereof)
So, if $\vec{F} = \frac{d\vec{p}}{dt}$ and $\vec{p}$ is proportional to $\vec{v}$ - let's say $\vec{p} = \alpha\,\vec{v}$ (I'm using $\alpha$ rather than $m$ because, again, I don't necessarily mean mass) - then
gain in KE = $\int_A^B \frac{d\vec{p}}{dt}\cdot\vec{v}\,dt = \int_A^B \alpha\,\frac{d\vec{v}}{dt}\cdot\vec{v}\,dt = \alpha\, \int_A^B \vec{v}\cdot d\vec{v} = \frac{1}{2}\,\alpha\,v^2\,\big|_{v_A}^{v_B} = \frac{1}{2}\,\alpha\,v_B^2 - \frac{1}{2}\,\alpha\,v_A^2$.
And there is your quadratic term, $KE = \frac{1}{2}\,\alpha\,v^2$.