Two main theories:
1. The sausages were believed to contain actual dog meat in the late 19th century; consumption of dog meat was common in Germany until the early 20th century.
2. In the mid-19th century, German immigrants to the US began selling thin, long variations of sausages and called them “dachshund sausages” due to their similarity to the dog breed. This may have eventually led to “hot dog.” (For etymologists, the appropriate term is "bastardization" of the original word. And no, bastardization is not a swear word...)