You can store anything in these formats that can be represented as a multidimensional array of numbers. The only thing to mind is that HDF5 works with any kind of label whereas leveldb and lmdb store "Datum" structs (as defined in the caffe.proto) that are usually better suited for one single class label (integer 0..N-1) per sample. See my post on creating an LMDB for caffe:
https://groups.google.com/d/msg/caffe-users/2xpmLJYmt5k/ApiOQ7NnAwAJ.
Which of these formats you choose should be your decision. And some basic reading about these formats wouldn't hurt either. I found HDF5 to be quite useful because it is really flexible and incredibly easy to use (at least in MATLAB and python, in C++ it is a bit more difficult).
Jan