If your car fails its MOT and its certificate has expired, then a garage can’t let you drive away as normal. However, if your car’s certificate is still valid (if it’s still within the expiry date on your test certificate) then you are able to drive it away, providing it hasn’t had any ‘dangerous’ defects listed against it.
If this is the case, then you can’t leave the test centre. Doing so could leave you liable to a fine of up to £2,500 if caught, as well as three penalty points on your licence and potentially even a driving ban.
You’ll need to have these issues rectified and have the car re-tested. If it passes, you’ll then be able to drive away.