The intersection curve between the objects involved needs to be a closed curve or end at the edge of an open object. That’s not the case in the case to the left in that image.
-wim
The “it” that you can trim is just one of the two objects, the other you can’t trim. For a boolean to work Trim would have to work on both objects.
This is one of the several reasons why using the Trim command is far superior technique to using a boolean for something like this.
Its not that big a deal to select both objects run the trim command then click on the parts you want removed then hit the Join button.
If trimming works on one of the objects but not the other then you know which of the two has an incomplete intersection. Often you can fix that by extending the intersection curve and complete the trim and then join the two.
When a boolean fails the people who rely on booleans have no clue what went wrong. They spend enormous amounts of time with superstitious beliefs about what to do, like moving the geometry or changing the tolerance.