As I mentioned in my Understanding Your Dog's Teeth Chattering blog, dogs have 300 million olfactory receptors in comparison to our mere 5 million olfactory receptors. Those 300 million receptors allow for dogs to communicate with one another. So the butt-sniffing trains we see at the dog park tell a whole lot more than we know.
With a long and deep sniff, the dog is able to read what is written in the scent molecules and pheromones. With the help of the anal sacs; two pouches on each side of the dogs butt - there is a secretion of chemicals that can give the dog further information:
Gender;
Reproductive status;
Health;
Diet;
Information about the owner;
Emotional State.
So in short, it's just their way of shaking hands, skipping the small talk and giving a big hello.