As you are aware Massachusetts normally requires a social security number in order to receive a MA driver's license. The MA Registry of Motor Vehicles (RMV) does have an exception so that a non-US citizen who does not have a SSN and who is not eligible for a SSN under current federal regulations or policies, may still be issued a learner's permit, driver's license or ID Card.
A non-US citizen without a SSN must provide acceptable identification documents, acceptable evidence that he or she has applied for a SSN but has been denied by the Social Security Administration, and must otherwise qualify for the permit, license or ID Card being sought. The RMV may then issue a driver's license if they see fit.
As for buying a car and insurance, from the best of our knowledge you should be able to do both even without a social security card. A SSN does not appear to be required to register an automobile in Massachusetts, but check with the RMV to find out all the steps to registering a vehicle.
Keep in mind that in MA purchasing a car can be costly. In addition to the price of the car, you must pay a 5% sales tax and fees for Registration and Title, as well as a fee to have the car inspected. You will also pay an annual "excise" tax - the amount of this tax is determined by the value of the car and the town/city where you live.
Car insurance is mandatory in Massachusetts and the cost is based on such factors as your age, driving experience, the value of your car, and your place of residence. As far as social security number and auto insurance, most companies will not need this unless they rate on credit, but even then they are not allowed to require you to use a Social Security number. To get a quote for a Massachusetts car insurance policy, start here with us.