You can score a goal directly from a goal kick but only against the opponents.
If you kick it into your own goal...
...and it did not leave the penalty area first, then the goal kick is rekicked.
...and it did leave the penalty area first, then play is restarted with a corner kick for the opponents.
There can be no offside offense directly from a goal kick.
Chat with our AI personalities
If the ball is literally PLAYED to the player by the opposition, then no, he cannot be offside.
However, if the ball takes a deflection off the opposing player, then the player must be ONSIDE when his team mate plays the ball, regardless of his position when it hits the opposing player.
Although the player is in an offside position at the moment of the kick, they are not guilty of an offside infraction because the ball was not passed to them by a team-mate.
A player may not be guilty of an offside infraction directly from a goal kick.
Goal kicks, corner kicks, and throw-ins are specifically mentioned in Law 11 as exceptions.