Yes. "An attack" includes primary weapon attacks.
Last: when it says hit, does it mean hit while rolling for attacks or deal actual damage ("hit")?
It means that you have uncanceled {explosion} or {hollow explosion} results remaining after all dice effects have been resolved. Essentially what it means is that unless you remove a shield token or deal a damage card you have failed to hit and gunner will trigger the second attack, with the exception being cases where damage is prevented or modified after dice are resolved. If, for example, your opponent uses "draw their fire" to take your only uncanceled die result on another ship the original ship is still considered to be hit by the attack even though it didn't receive any damage cards or lose any shield tokens.