In some places it may be illegal to throw a dead animal in the trash but people throw dead animals in the trash dumpsters and trash cans all the time and never really get into trouble.
If you need to throw a dead animal in the trash then do so as it's unlikely that you'll get into any trouble for it.
If possible you could just dig a hole in your backyard and bury the animal such as a bird, dog, cat etc.
Whenever I had a pet die such as a dog or cat I would just dig a hole in my backyard and bury the dog and cats there and never have I gotten into trouble for it.