It is absolutely fine - I do this every time.
However - there are some countries where passport control is linked to the PNRs (e.g. Croatia). So if you go through on the wrong passport, they may take time to punch all the details in again for the passport you present. Just slows down your trip.
Also if you need a visa for the target country, make sure you have used that passport in the booking. Similarly if one passport doesn't require a visa, use that one in the booking or there will be confusion.
So ideally at check-in you put in the details for the best passport for the target destination.
For the UK its easier to leave and return on EU passport anyway as it's just a gate check and e-gate on arrival.