If your flags are in good shape overall but have a slight rip, you can fix them. However, your patch should be barely noticeable. Furthermore, you should not make major changes to the size of the flags throughout the repair process.
Federal law enforcement authorities set the size criteria for flags. According to these rules, the length of flags must be 1.9 times their width. If you are concerned that you will not be able to, take the damaged flags to a skilled tailor or conservator if they are second-hand ones.
If the flags are damaged or tattered beyond repair and is no longer suitable for display, they should be disposed of in a polite and dignified way. The best way is to burn them.