It helps to establish the characters. By writing dialogue first, you can get a better sense of how your characters speak, their personalities, and their relationships. For example, if a character uses a lot of slang and short sentences, it might indicate they are young and street - smart.
Doing dialogue before story sets the mood. The way characters interact through dialogue can create a certain atmosphere. For instance, if the dialogue is full of tension and quick exchanges, it can make the overall story seem more suspenseful.
It can also guide the plot. The topics that characters discuss in the dialogue might give you ideas for the direction of the story. Say the characters are arguing about a missing treasure in the dialogue, that could be a central plot point in the story you build around it.