Allays do not check the dimension of the liked note block. If multiple dimensions have note blocks at the same coordinates, allays will deliver items to any of these.
- Place note blocks in multiple dimensions at the same coordinates
- Spawn an allay
- Have it hold an item
- (Optionally) run /data modify entity @e[type=minecraft:allay,limit=1] Brain.memories.minecraft:liked_noteblock_cooldown_ticks.value set value 100000 to increase cooldown for easier testing
- Play the note block in one dimension
- Teleport the allay to the other dimension e.g. via nether portals
- Drop items and have the allay pick it up
- Check whether the allay drops the items at the note block or the player
The allay will bring the item to the player, because the allay is linked to the note block in a different dimension.
The allay will drop the item at the note block.