While in the Warped Forest killing Enderman, I gave my Allay an Enderpearl to collect them, but when I spammed an Iron Sword enchanted with every max enchant for swords, including Fire Aspect II (2), the Allay would catch on fire if it flew into my crosshair and I hit it. It happened repeatedly, but Allays are not supposed to be able to be damaged by the player when given an item. I don't think the Allay was affected by any normal damage (Because it didn't die when I hit it with a Sharpness V Iron Sword), but it caught fire and took damage; it did not die because of its regeneration.
I just realized this is a duplicate bug report because I didn't search well enough beforehand. Sorry for any inconvenience.