Can I use the battery from an early 2014 MacBook Air in a mid 2012 Air?
Yes. According to iFixit, all 2010 through 2017 MacBook Air's use the same battery:

https://www.ifixit.com/Store/Mac/MacBook-Air-13-Inch-Late-2010-to-2017-Replacement-Battery/IF188-113-2

That's assuming we are talking about the 13". If you are talking about an 11", that changes things.