Approach to save many to many relationship in case select all values I have Countries mapped to Products as many to many relationships. As a result a new mapping table is created with product_id and country_id. If a Product is saved then multiple country_ids are stored in new row against product_id, which is fine in case if there are 20 or 30 countries chosen.

But if there is select all option which contains almost 300 values, is it good to go with this approach? or I should use a flag to identify that it is for all values(Countries).
If you use a flag in the products table assume it's a bit data type and set to True which means that product is related to all countries, no doubt you will have less record in the database but your query becomes a bit complex.

If you go with the first approach using the regular joins on foreign keys would also solve the problem with simple queries.

I would prefer to go with a proper many-to-many relationship approach with proper indexes, avoid updates and simple query joins. However if the need arise of having a helper column to say this product is applicable in all countries then I would add it but only if the issue arise.