Yes and no, Europeans had no understanding of germ theory. Certainly they had some notion of contagion but didn't really know any of the mechinisms by which disease could spread.
In the americas, what is interesting is that they did not know that their diseases were alien to the Americas, why would they. Eventually they figured this out, but it took a long time. One side effect of this process was that Europeans came to believe that Native Americans were 'weaker' had poorer 'constitutions' than Europeans and Africans because they died at such higher rates when suffering from these diseases.
This also tended to accelerate the importation of African slaves in areas where labor was most in demand leading to the rise of African slavery in the Americas and in particular the plantation model for sugar cane production.
Born to Die Disease and New World Conquest, 1492–1650
The Columbian Exchange
Follow up question: Were there any diseases that were transmitted from Native Americans to Europeans?