OUTER JOIN Works in one direction but not the other
There are two (plus 1) - seemingly independent - relationships between models and locations. One relationship is in model_locations and the other two in models.

I find both your queries to be incorrect because they don't examine the relationships independently. If there is a relationship (between a model and a location) only in one of these two tables, the query will not return any. Using LEFT joins might be possible but seems inappropriate, too.

I'd use simple OR conditions with EXISTS subqueries or a UNION:


Final all locations of a certain model (17):

SELECT 
    loc.* 
FROM 
    locations AS loc 
WHERE EXISTS
      ( SELECT 1
        FROM model_locations AS ml
        WHERE ml.model_id = 17 
          AND ml.location_id = loc.id
      )
   OR EXISTS
      ( SELECT 1
        FROM models AS mod
        WHERE mod.id = 17  
          AND loc.id IN (mod.location_from_id, mod.location_to_id)
      ) ;

Final all models of a certain location (11):

SELECT 
    mod.* 
FROM 
    models AS mod 
WHERE EXISTS
      ( SELECT 1
        FROM model_locations AS ml
        WHERE ml.location_id = 11 
          AND ml.model_id = mod.id
      )
   OR 11 IN (mod.location_from_id, mod.location_to_id)
 ;