This is common in employment contracts as well.
Yes, it's legal - it's enforcement can be questioned when the excluded region / excluded practice is so broad as to restrict the possibility of future employment*.
*I'm not a solicitor but have gotten advice on a similar clause in an employment contract.