On the way home from school, I played with a girl who had a dog.
Literal
Leaving-school [possessive-の] on-the-way [at-で] dog [object-を] brought girl [and-と] played.
下校 ('leaving school, going home from school') pairs with 登校 ('going to school'). 途中で ('on the way, midway') marks an incidental event during transit. つれた (from 連れる 'to bring along') modifies 女の子 as a relative clause. A simple, slice-of-life sentence typical of children's diary entries.