Agreed that sample contexts would help, but as a generality there's no reason why 'The flag of Spain'; 'Spain's flag'; or 'the Spanish flag' should have any difference in meaning. One version could well be more appropriate than other in a particular context, though.
While "the flag of Spain", "Spain's flag", or "the Spanish flag" are all correct, as e2efour said it is not normal to say "Spain flag", and without a very particular context saying "Spain flag" instead of the other three choices will be incorrect.
Forero, do have in mind something like "He thought they were Georgians, but then saw that they were flying an Azerbaijan flag"? I wouldn't be surprised to see that, but I would consider it an error for "Azerbaijani flag." "... flying the flag of Azerbaijan" would be fine. There isn't a "Bengal" to have a flag, but I would expect "Bangladeshi flag," not "Bangladesh flag."
In the U.S., we use "flag" without a possessive with "____ state": "At old Fort Niagara, they fly the United States flag, the New York state flag, the British Union flag of 1707, and the French Bourbon flag." But I certainly wouldn't write "the United States flag, the New York state flag, the Great Britain flag of 1707, and the Bourbon France flag." I don't know why.
Sorry about the confusion. I wouldn't write the second phrase in quotation marks as a whole because of the presence of "the Great Britain flag of 1707, and the Bourbon France flag" as the 3rd and 4th elements; of the two sets of four flag designations, I would write the first but not the second. The second set has two common elements with the first ("United States flag, New York state flag") and two elements that are different ("British Union flag of 1707" in the first vs. "Great Britain flag of 1707" in the second; and "French Bourbon flag" in the first vs. "Bourbon France flag" in the second). So as a set of four flags, I
would write: "the United States flag, the New York state flag, the British Union flag of 1707, and the French Bourbon flag"; whole set: would not write: "the United States flag, the New York state flag, the Great Britain flag of 1707, and the Bourbon France flag"; whole set: