After giving allay an item, it recieves a tag CanPickUpLoot: 1b, which allows it to equip armor.
Reproduction steps:
Give allay an item.
Place a dispenser with a piece of armor next to it.
Activate a dispenser.
An allay now wears said item.
This only applies to allays that hold something.
An expected behaviour would be that dispensers wouldn't be able to equip items on allays.
Just tried this myself and equipped an allay with a netherite helmet using the same method.