The short answer is, probably not. But it depends on what you're doing.
Flour and cornstarch are two different things. Ordinary flour is made from wheat, and it contains protein, starch, and fiber. The protein, known as gluten, is what causes dough to become elastic when you knead it, and it gives baked goods their structure.
Cornstarch, on the other hand, is made from corn meal which is processed to separate the protein and fiber, leaving just the starch.
Since it's pure starch, you couldn't bake with cornstarch, since there's no protein or fiber in it.
Cornstarch: What Is it Good For?
What cornstarch IS good for is thickening things like sauces, puddings, and pie fillings. That's because when it's cooked, a starch acts like a sponge, absorbing liquid and expanding as it does so.
It also gelatinizes, which means it sets up firm when it cools, which is what you might want a cream pie filling to do.
But because it's pure starch, cornstarch has twice the thickening power of flour. So you would have to use twice as much flour to achieve the same thickening as cornstarch. Too much flour will cause your sauce or filling or whatever to turn thick and gummy, and have a floury taste, which probably isn't what you want.
Additionally, cornstarch imparts a shiny, translucent appearance, which is a desirable feature for fruit pie fillings and certain sauces (especially in Chinese cuisine).
Flour won't do this.
Deep-Frying with Cornstarch
Cornstarch can also give deep-fried foods a crispy coating. This works because the cornstarch absorbs moisture from the food and expands, and then when the food is fried, the moisture cooks out of the cornstarch, leaving the crispy, the puffy coating on the outside.
Flour will do this to some extent, but again, you'll need to use more flour to achieve the same effect, and it will be a thicker, chewier coating, rather than the light, crispy one the cornstarch produces.
So in general, you can substitute flour for cornstarch, but you'll have to use twice as much flour as cornstarch, which will make the result heavier/denser/thicker than the recipe intends.
A better solution would be to substitute another starch, such as arrowroot, potato starch, tapioca starch, or even rice flour.