means that
dirty or unpleasant work can nevertheless be financially rewarding. Muck means dirt or manure, and brass is a colloquial term for money.
brass is a slang word for money
Imagine a case where where there is manure (and mud) there will be good crop and consequently good money for the farmer.; then “Where there is muck there's brass” fits well.