It could definitely come from feces from another infected animal. Also, dirty conditions can make it so much worse. Contaminated water and environment are causes for sure! There are some chin breeders/rescues that do not treat their animals and pass this on to unsuspecting owners. It is very contagious and chins will pass it to other chins with minimal contact.
Albon is probably the best treatment, as stated before. Coccidia can cause extremely bad diarrhea, it seems to take down chins very quickly. Any chin suspected of having coccidiosis should go to the vet immediately and be tested and then be treated immediately 2 to 3 times a day with Albon (the albon suspension is the easiest way to go.)