Yes, daffodils serve that function. There is something about bulb plants (spring flowers, onions, garlic) that must taste bad to most critters because they don't eat them. I started planting daffodils around young trees several years ago after I read somewhere (don't remember where) that they would discourage rabbits. It's worked so far, even for young trees near old orchard trees that have branches hanging near the ground that rabbits have ravaged. It's even true of young fruit trees I have near a neighbor's young trees that have been girdled by rabbits.
I also use plastic drain tile pieces as described by Quercus Bicolor on some trees. That works very well, but I like the daffodils in spring.