If you tried saying that you weren't driving, and blamed somebody else you could end up deeper water - charged with attempting to pervert the course of justice.
If you weren't caught out, there could be possible insurance offences if the person you named wasn't insured to drive your car - in which case you'd get 6 points or more for causing or allowing an uninsured person to drive your car.
If someone agrees to say that they were driving, and then you get found out, you'd both be charged with attempting to pervert the course of justice. A conviction for that offence nearly always results in imprisonment (for both persons), with typical sentences being in the range of 6 months to 2 years.