Essentially fruit flies are not the worst thing. They cannot bite so you don’t have to worry about that. They also would not be unhealthy to eat just on their own. The problem with fruit flies is that they can carry diseases, bacteria, and viruses. Fruit flies can carry diseases and bacteria from one place to another and therefore spread these things.
If you eat rotten foods or foods that fruit flies have been on you stand a chance of getting sick not specifically because of the fruit flies but simply because of the things that they are able to carry around from one place to another. If you should ingest a fruit fly you should remain calm and remember that there is nothing dangerous about actually ingesting fruit flies themselves.