Only if you're fine with them being indistinguishable.
The flags of Indonesia and Monaco are easy to tell apart if they're the correct aspect ratio, because the flag of Monaco is much narrower. If you force both of them into the same shape, as this collection does
they only differ in the shade of red. And I think they got it wrong: Indonesia's red looks darker than I'm used to, Monaco's looks brighter.
If you absolutely need to fit many different flags into a uniform rectangle, you'd better keep the aspect ratio and leave the rest of the rectangle transparent. And don't forget to include a differently-colored border so people can tell where white stripes end (or whatever your background color is.)