Spoiler from Seasons 1 and 2 ahead
How does Delores get off her loop to leave home and meet William?
In the third episode of the Season 2, Dolores meets her father
in the Confederados fort, where she is starting a war between hosts and humans.
She explains that all started when she ran away from the farm because he told her to run away. I didn't locate the exact scene in season 1 but we can assume it is when he became insane after seeing the real world photos.
It seems so far (*) her path and William's one crossed by luck (versus destiny or programmed encountered). At least, William believes it. In one of the last scene of season 1, a young William meets a Dolores whose memory of the adventure together has been erased and is starting a new loop in Sweetwater. He tells her that encountering her was lucky and gave him his purpose in life.
the process of struggling with the gun (because she would never hurt a living thing) we see her flashback to the image of the Man in Black.
As @Moo pointed out in the comments, two different timelines overlap: the "present" where the Man in Black is using the host to find the center of the maze, and the past timeline where William is having his first trip into West World. They are about 30 years apart.
- In the "William timeline", the farm is attacked by hosts and is made to run away by her father's words. She has no gun at that time. She then meets William and Logan, and their adventure in Pariah and other places.
- The "Man in Black timeline", where she is attacked by the Man in Black one more time. I think the Man in Black attacks her to trigger the same behavior than in the "William timeline", that is run away and leading him to the center of the maze. She has a gun in that scene (put in the ground by Bernard under Ford's command).
(*) I watched only until Season 2 episode 3 so far, and we know that, with Ford, nothing is really random.