Yes - you can do this. You are obviously in breach of contract, but a firm isn't going to seek some form of compensation for you doing so, because there is little to no value in them doing so. They will just back fill your role.
Just be mindful that the moment you even start onboarding processes for the LPC/GDL/SQE, you maybe making a financial commitment to the firm (even if you haven't started the course). So that will typically be the point in which I recommend people make a decision to either commit or renege on a firm.