Yes. Both spellings are valid. Supposedly derived from the fact that everyone laughs at you when you fall in to it!
"[French, exclamation of surprise, ha-ha (from its being designed not to be seen until closely approached).]" - from dictionary.com
However, a 'haw' is an old name for a hedge (hence hawthorn) ....