How can I press escape on a Bluetooth keyboard with my iPhone?
Terminal hasn't been updated for nearly a year now, so unfortunately there are some imperfections as things change in iOS. 
But for this case, though, I believe the escape key is actually controlled by SpringBoard, not any apps, which means Terminal can't capture and send the escape key to the command-line program. 

The iPhone Wiki article on Terminal has information on keyboard shortcuts, and it says that the key shortcut for escape is Ctrl + [ (• + [ on the virtual keyboard).

However, if my assumptions above are correct, the only way to use the real escape key would be to write a tweak to redirect the escape command to Terminal.