Assuming Oswald acted alone.... which he did. Even firmly dismissing the theories that he couldn't shoot while JFK on Houston Street because of co-conspirators and other shooters being in position around Elm Street or other utter bs like that, it's still a fair question as to why Oswald didn't shoot when the motorcade was coming towards him. And in fact, we may never know the answer. Maybe he got cold feet for a minute, and only found the "courage" (for lack of a better word) to go through with the assassination by the time JFK was on Elm Street. Or maybe Oswald had some technical malfunction with the weapons that he had to take care of first, and by that time the motorcade was already on Elm Street.
The one thing I did always agree with was that the motorcade coming towards him on Houston Street would have been a more logical shot than the way it went down historically. Does this mean Oswald didn't do it, there was another shooter, or whatever other crazy conspiracy theories have come up through the years? Absolutely not, Oswald acted alone, and shot JFK on Elm Street. The question why he didn't took the easier shot on Houston Street might remain a mystery forever.
Well, since JFK was surrounded by secret service and police, one of them would have easily located the source of the gunfire and return fire. The reason why Oswald shot him as he turned on to Elm is because he wanted to escape.
Secret Service only cares about protecting the president. I seriously question if they were going to shoot at the TSBD building from a distance. They didn't even fire at the assassins during the various assassination attempts against Gerald Ford and Ronald Reagan (Squeaky Fromme, Sara Jane Moore, John Hinckley Jr). I do believe Secret Service and police knew exactly where the gunfire was coming from, hence why none of them rushed towards the grassy knoll or anything like that. Bringing JFK to safety however was an obvious higher priority than acting against the assassin.