Most pets would eventually learn who provides food,including hamsters
This is even true of some reptiles!I can't say that they love exactly like humans(they're not social to begin with,so it would just not be realistic)but I can definitely say with absolute certainty that trust is developed with positive association.