In the world of dreams the rules of reality do not necessarily apply. Each dream is unique and it's a direct link to the soul and spirit. Psychology provides its own theories on what dreams mean, but so did tradition and the study of dreams for thousands of years before any relevant science had developed.
Dream Meanings - Viper
If you dream that a viper bites you then someone you think is a friend will cause you harm. If, however, you kill the viper then you will escape the problems that someone you believe is a friend is trying to create for you.