need help training

Ema • Mother of 2 married to the love of my life

this is my baby Loki. my hubby found him a few days ago in our garage, he's such a sweetheart and really loves people. we fell in love the instant we looked into he big brown eyes. his original owners live down the street and were obviously abusive. we let them know we have him but they deny he belongs to them (though everyone in the neighborhood has confirmed he was their dog) anyways he has aggression towards other dogs but only when they run towards him he'll run away and then start to get aggressive when they get too close to him almost like he's afraid. Is there a good way to get him socialized with him attacking another dog?