Short answer: yes.
General answer: you can use any input device for use as unlock mechanism. You can use a keypad, several single buttons, you can even use a single ultrasonic sensor (and depending on the distance differences from that sensor create a pattern), you can use a microphone, a temperature sensor (that will be tricky to unlock something though).
I would start with a typical example of an ultrasonic sensor sketch and program a pattern recognition algorithm in it. How that sketch would look like exactly, depends on your requirements (how you want to store the pattern, should it be hardcoded or changeable).
First try one sensor, than try multiple (I never tried, but I guess it's possible). If not by a default library, you have to write your own (that will be tricky possibly). Than think about the pattern recognition (values of the ultrasonic sensor in the correct order), than about changing/storing the 'code'.