Arthur Dayne was a King's Guard yes
And a friend to Rhaegar.
As to what he was doing there. Well King's Guard members usually defend members of the royal family, they still do on the show in present Day. Jaime, Merryn Trant and several other King's Guard have stood watch over Robert, Joffrey and Tommen.
If Lyanna was pregnant with Rhaegar's baby, then that would explain what Arhur Dayne, Gerold Hightower and Oswell Whent was doing there, instead of participating at the Battle of Trident and protecting Rhaegar's life. They were protecting a member of the Royal family
And if R+L=J is true, then Lyanna wasn't a prisoner in the tower. Ned just didn't know that. He thought that he was saving her.