Yes. It was called Miasma Theory. This was believed from Roman times right up until the 19th century. The invention of the microscope lead to Germ Theory. In pre-industrial times it was thought that bad smells caused disease because they noticed disease would often occur around rotting flesh.