To reproduce (Nether);
1.) Give an allay any item you want them to hold.
2.) Trap them in a box, with any blocks that you want to use.
3.) Nearby that box, make a nether portal and go into it. --> allays follow you to the nether even if they are trapped
Expected: Allays cannot follow a player when they are trapped in any box/farm even in the nether.
Not Expected: Allays can follow you on the nether if you go to the nether or logging in.
Thank you for your report!
We're tracking this issue in MCPE-158982, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki