Yes they can lose appetite due to hairballs. My Magpie always lost his appetite for a day or 2 before bringing up a hairball. I guess if they have a load of hair in their stomach they will feel full on less food. If you have any doubt that it's due to hairballs or it lasts more than a couple of days (or there are other symptoms too) it would be a good idea to take him to the vet. And of course if he stops eating at all that can be serious so a vet trip would be in order sooner rather than later.