Prima facie all flags would be artistic works with copyright vesting in their creators; either the designer or the designer's employer. The copyright is probably owned by the government of the relevant country either by virtue of the creator being an employee or by transfer.
However, a significant number would be in the public domain because:
- They were created before the legal concept of copyright existed (e.g. Denmark - 1219)
- The term of copyright protection has expired (e.g. United Kingdom - 1801)
- It is government policy that government works are public domain (e.g. United States)
Notwithstanding, it is extremely unlikely that you could be successfully prosecuted for copyright breach for using a national flag design as you would have a near watertight fair use/fair dealing defence for public policy reasons.