You need to place the icon anywhere within the game's materials folder (tf/materials in your Team Fortress 2 installation directory) and then set the icon property of the flag to ../(path to your icon).
An example would be putting my .vmf and .vtf each named "my_cool_icon" inside tf/materials/hud. If I would do that, I would need to set the icon property of the flag to "../hud/my_cool_icon" (without the extension!).
Another example would be to use the custom directory - placing my texture files into tf/custom/(Some name, you can think of your own)/materials/hud would have the same result as if I placed it into tf/materials/hud (the same path from the above example).
Do note that it's the .vmf you need to put into the icon property - when the .vmf is loaded, it will automatically try to load your .vtf based on the path you set in the .vmf. Also keep in mind that the shader used for your .vmt (the thing on the first line in the quotes) should be UnlitGeneric.
Also remember to look up on how to pack your maps, otherwise other people will not see your icon!
Hope this helps, if not, I could attempt to help further ^^