I frequently give talks to gardeners, and pictures of deformed squash infected with a virus are some of my favorite shots to share. Inevitably, someone asks, "Could I catch the virus that made that plant sick?"
In most cases, the answer is no. The fungi, bacteria, viruses, and nematodes that cause disease in plants are very different from those that cause disease in humans and other animals. Eating or touching an infected plant would not infect us with the same pathogen that is making the plant sick.
However, produce from sick plants often has a flavor or texture very different from healthy produce, so eating it may not be desirable anyway. Unless the disease is merely a superficial spot (such as sooty blotch and flyspeck on an apple), it may be best to avoid diseased produce.
There are very few pathogens that can infect humans as well as plants, and those that do tend to be "opportunistic pathogens" of both, only able to infect weakened hosts. Perhaps the most notable of these pathogens is the bacterium Pseudomonas aeruginosa, which can cause a weak soft rot of plants such as lettuce. In people with compromised immune systems, this bacterium is known to infect the urinary tract, lungs, blood, and burns and other wounds. It is especially common in hospitalized patients whose immune systems are compromised by severe burns, cancer, AIDS, or cystic fibrosis. For most of us (and for most healthy plants), P. aeruginosa is not a concern.
Some fungi that live on decaying plants can cause disease in humans. One example is Sporothrix schenckii, a fungus that frequently lives on dead rose thorns. This fungus can cause sporotrichosis, also called "rose-picker's disease", if it gets into a person's skin (such as through a scratch) and into the lymph system, or if a person inhales its spores. Symptoms of this disease in humans can include problems with the lungs, eyes, central nervous system, bones and joints. For more interesting information on this fungus, including a gory picture of infected skin, please see http://botit.botany.wisc.edu/toms_fungi/feb2003.html
Additionally, some plant pathogenic fungi produce compounds that can be toxic to people, although the pathogen itself does not infect people. For example, some fungi that cause ear rots on corn, such as Fusarium, produce "mycotoxins" (toxins produced by fungi). The mycotoxins produced by Fusarium include fumonisins, zearalenone, and the aptly-named vomitoxin. Effects of mycotoxins in livestock that are fed contaminated grain can include development and reproductive problems, vomiting, general lethargy, and death, depending on the particular mycotoxin present and the level of contamination. Aspergillus flavus is a common contaminant of grain and peanuts, and it produces mycotoxins called aflatoxins. At very high levels (acute exposure), aflatoxins can cause vomiting, pain, convulsions, and death. At lower levels of longer duration (chronic exposure), they can lead to cancer. Mycotoxins are generally an issue only on grain, not on common garden produce, and grain for human consumption is well monitored for their presence.
In general, pathogens that infect plants cannot infect people. You are not likely to catch a disease from working with diseased plants in your garden. Garden produce from a sick plant is generally safe to eat, although it may not be desirable. Avoid eating moldy or rotten produce, though, as some fungi and bacteria can produce toxic compounds.