The character of Jack Dawson is a fictional character created for the movie. There was no real-life person named Jack Dawson who sailed on the Titanic.
The idea of Jack being a ghost is likely a result of the romantic and tragic nature of the movie, where his death is a pivotal moment.