Check your contract carefully first.
In most circumstances an employer wont try to stop you - the cost, both financial and potential damage to a client relationship by being seen to be unnecessarily litigious, usually outweighs any benefit of stopping such a move. It does depend on what you do and your seniority of course. If your joining would effectively make your current employer redundant from the project, because it is very niche for example, or you are very senior, they may feel they have to take steps to prevent you moving there. But in most instances it happens without incident. It certainly happens more often than you might think.
Probably best way would be to engage the client and if you were then offered a role, put this as a fait accompli to your current employer and stress that you will of course be promoting them as a business partner (as a happy leaver).