Flour is not an ideal substitute for cocoa powder.  It doesn’t have as much fat as cocoa powder and is less acidic, so the recipe may not turn out right.  Additionally, flour clearly won’t add any chocolate flavor or darker coloring to your recipe, which is often the point of the cocoa powder.