It is possible that sewage is used as fertilizer, as it is in many parts of the world although there is no evidence that garlic in China is fertilized in this fashion. In any case, there is no problem with this, human waste is as effective a fertilizer as is animal waste. Spreading human sewage on fields that grow crops doesn't sound appealing, but it is safer than you might think. Urine is normally free from the pathogens that cause diseases, while soils  bacteria found in feces. Actually the skin on garlic is effective at preventing penetration into the bulb. Of course it is a good idea to wash the bulb before using, no matter where it comes from. A dip in boiling water is an added safeguard.
Sewage is not simply waste to be disposed of as fast as possible, but a valuable resource. Flushing sewage into rivers is not just an environmental catastrophe, it is a nonsensical waste of nutrients that could be helping to feed the world. A person produces 500 litres of urine and 50 kilograms of feces a year. Besides the water and organic carbon, our annual output contains around 10 kilograms of nitrogen, phosphorus and potassium compounds, the three main nutrients plants need to grow, and in roughly the correct proportions. The world’s population excretes 70 million tons of nutrients annually. Applied to fields, this could replace almost 40 per cent of the 176 million tons of nutrients in chemical fertilizers used by the world's farmers in 2011. Processed and handled correctly, the organic carbon and nutrients in urine and feces makes soils more fertile and better able to hold moisture. Recycling our waste onto fields would increase food output and make life a lot easier for poor farmers, who often cannot afford fertilizer.