You might be a
Mouse (small mammal)
but maybe you are a
Mouse (computer accessory)
I may have four legs, or I may have none-
I may have two ears, but perhaps I cannot hear.
I may have two eyes, but could it be that I cannot see?
the first possibility always refers to the mammal, the second to the computer mouse
Either way, I can be found in your home;
OP probably lives somewhere where mouse infestations are more common
Either way, something trails behind me.
tail or cord
Either way, some may touch me while others refuse.
mice (especially the furry ones) scare some people
Maybe I can eat, but maybe I cannot.
same pattern as before
Maybe I rely on shadow, but perhaps I rely on light.
mice hide in the darkness, an optical mouse uses light to detect its position
Maybe I am scorned, but I can also be loved.
mice are considered pests, but sometimes kept as pets
I can signal the demise of the world,
rats and mice seem to have taken cities over in almost every post-apocalyptic movie
Or I may be the key to unlocking it.
Do you know of whom my tale speaks?
Not really, no.