The statue is of a famous Sky Terrier called Bobby. His owner was a policeman who died in 1858 and was buried in the nearby Kirkyard. Bobby is said to have spent the next decade sitting on his master's grave before being burried himself just inside the Kirkyard gate. The story has spread and been embellished by several books and films.
See Wikipedia: https://en.wikipedia.org/wiki/Greyfriars_Bobby