I think MD's tax just went up to 6% last January (to match the neighbors... how nice).
I bought my beloved Bug in PA two summers ago and lived in MD at the time. In MD taxes on the car are due at the time you register the vehicle, regardless whether you just bought the car or are moving to the state.
When buying a car to bring to MD from out of state, here are some tips and hints I would suggest:
1) If it is a private sale in another state (DC, VA, PA, etc) and you're bringing the car to MD, make sure that the seller signs the official MD DMV bill of sale form with the price you paid (wink wink nod nod) and has his/her signature on that form notarized. If you don't have this form, the MD DMV will assign a value to the car (KBB, I think, but the value they assign is usually higher than you actually would ever pay) on which taxes are due. I paid 18,5 for my Bug, and if I hadn't had the seller's notarized signature on the Bill of Sale form, I would have had to pay taxes on 24k (the value they assigned to the car) vs the 18,5 I actually paid. This is huge. Don't try to claim that you bought a 45k car for $100, though. You can call the DMV and ask them ahead of time what they believe the value of your car to be.
2) If it is through a used car lot (particularly in DC/VA) then they have TONS of experience with cross-line tax issues and you shouldn't worry too much. If they send the paperwork to the DMV for you you'll pay MD taxes then and there; if not make sure they don't charge you any other states' taxes when you pay, and again, you'll pay taxes when you register.
Edited to add: The inspection and emissions issues are true concerns, particularly when talking about older cars! Safety inspections are done only once before you register the car, but emissions tests are every two years, IIRC. MDs emissions standards are very strict and inevitably emissions are the one area where the repair costs can really add up! I would consider a car with a recent DC/VA inspection certification (within 3 months) to be a fairly low risk, though
Edited to add again: Actually, my advice in 1) goes regardless of where you buy the car - in or out of state if it's a private sale, get that Bill of Sale form from the DMV with a notarized signature. Other than potential hidden inspection issues, I don't see any reason not to buy a car in DC or VA if you live in MD.