Most likely you can do it on the way into DUB, but you will likely be forced to pay for the luggage ex DUB to LHR based on the EI fees- check it out, it could cost you a lot if luggage is heavy.
If your EI flights are actually booked as BA code shares, then you are probably ok in both directions