Could the cabin crew open the lavatory door from outside when someone locked the door from the inside?
Apparently yes. It has been mentioned in a number of places. One of the methods given is pretty simple:

Step 1: Approach locked lavatory
Step 2: Lift &quot;LAVATORY&quot; sign
Step 3: Slide the knob into the unlocked position

Thats all to it, though they may vary with the aircraft.

As @RalphJ points out in the comments, it should go without saying that unless you are cabin crew, you should not be doing this.