Yes, heat can kill fruit flies and their eggs. Exposing fruit flies to high temperatures, such as those generated by a microwave or oven, can quickly kill them and their eggs.