Why do humans smell arsenic as garlic or cyanide as almonds? Do both smells activate the same receptor? Is there any reason why our brain interprets these smells the same?
According to CDC.gov and Toxnet, bitter almonds contain cyanide, which, gives them the characteristic odor, but this can be also due to benzaldehyde (PubChem), which is, by the way, used as almond flavor for cooking (Wikipedia).
Garlic has its odor due to allyl methyl sulfide (Wikipedia) and not due to arsenic, which is not present in garlic in significant amounts. Arsenic as such does not have garlic odor and foods high in arsenic, such as rice, chicken, fish, beer and wine (Prevention) do not smell like garlic.
However, poisoning by toxins, such as arsenic, thallium, organophosphate pesticides, selenium and tellurium (FPNotebook, PubMed) is followed by addition of the methyl group (CH3) to them by normal intestinal bacteria, which gives them the garlic-like odor.
So, the connection between the garlic odor of garlic and arsenic (or other) poisoning is in the presence of methylated substances: allyl methyl sulfide in garlic, trimethylarsine in arsenic poisoning, dimethylselenide in selenium poisoning, etc (PubMed).