In Tales of Beedle the Bard, Sir Nicholas (Nearly Headless Nick) is described as having been a wizard at the royal court before he was executed. His ghost then went on to Gryffindor Tower at Hogwarts.
It is true, of course, that genuine witches and wizards were reasonably adept at escaping the stake, block and noose [...] However, a number of deaths did occur: Sir Nicholas de Mimsy-Porpington (a wizard at the royal court in his lifetime, and in his death-time, ghost of Gryffindor Tower) was stripped of his wand before being locked in a dungeon, and was unable to magic himself out of his execution [...]
Tales of Beedle the Bard - page 13 - Bloomsbury - The Wizard and the Hopping Pot
How did the house ghosts end up at Hogwarts?
Nearly Headless Nick is referenced above.
The Bloody Baron (Slytherin) and Helena Ravenclaw both died in Albania, when the Bloody Baron killed Helena Ravenclaw and then himself. If they both died in Albania, how did they end up haunting Hogwarts? Albania and Hogwarts were quite a distance from each other.
Is any information available about the Fat Friar (Hufflepuff)? How did the Friar die and end up at Hogwarts?
Another way of asking this question is If the ghosts of the Hogwarts Houses were killed or died elsewhere, how did they end up at Hogwarts in their afterlife? Shouldn't they have haunted the place where they had died?
★ I'm looking for an answer based in canon (the three Harry Potter novels, the three supplementary books, J.K. Rowling interviews, and Pottermore) and do not prefer an answer from the HP Wikia or the Wikipedia. However, if ghost lore that is relevant to this question comes from a reliable, but non-canon, source, I will gladly consider it.
three Harry Potter novels... I thought there were seven.