Not a bad idea. But you must plan it out thoroughly. So along with your commerce degree (or maybe in the final year of degree), you can do an online course in computers such as a programming course in Python, from Coursera, Udemy, NPTEL, or other online platforms. If you have already done some programming in school/college and it doesn’t interest you, then consider doing a course in Excel, advanced Excel, KNIME Analytics, or some courses in business analytics or data analytics.
Once you have completed your B.Com. or another commerce degree, get a job, and along with that start your preparation for the MBA entrance exams (in fact, if you have made up your mind on doing MBA, you can start entrance exam preparation even now – its never too early to start preparing for exams). Get about 2 years experience after your degree and crack that MBA exam.
All the best for your career.