As a woman, I would without a doubt be in 7th heaven if my boyfriend would surprise me with a dress. They're a very timely and romantic article of clothing and as a gify, basically say "I think you're beautiful".
Buying a dress for a woman, though, is a little bit tricky. Women themselves are very picky when buying dresses and are always looking to single out the ones which flatter their features. If you're not taking her along or not taking along a woman with her similar proportions, It'll be more difficult but still doable.
First of all, you absolutely must know her size. Take a look at any of her other dresses and make sure you know which size she is before going shopping. Second, make a mental note of her closet inventory - what does she normally wear when you guys go out? Is she on the minimalistic side, colorful side, does she like wearing revealing clothing or does she prefer to wear dresses and shirts that are a little more closed up? Does she like to reveal her legs or does she prefer clothing and dresses that cover them up? You may know which colors are her favorites, but which of those does she actually wear?
Here's a tip - make note of the neckline of most of your girlfriend's tops. Bigger breasted women find v-neck necklines more flattering, smaller breasted women prefer to wear round necklines or strappy topped dresses.
The key to buying an article of clothing such as this is knowing what it is your girlfriend likes and what her preferences are. If you've got that set - you'll have no problem! Good luck!