ALLEGRO_LOCKED_REGION has a format variable that will tell you the format. You have several options:
1) Easiest but not optimally quick. Pass whatever format you want to al_lock_bitmap and the data will be in that format.
2) Pass ALLEGRO_PIXEL_FORMAT_ANY and it will automatically choose the format that the bitmap data is already stored in. Faster because there is no conversion.
As for how to read/write the different formats, every pixel format in Allegro specifies in its name the order of the bits/bytes such that the most significant bits are mentioned first. Example: ARGB_8888 means each component is 8 bits, therefore the whole thing is 32 bits, and would fit in an int like this: 0xAARRGGBB. So to create a pixel out of 4 bytes for example you would do pixel = b | (g << 8) | (r << 16) | (a << 24);.
The problem you might encounter is that some machines may use big endian byte ordering but that's rare. So even though 'A' comes first, if you were writing a byte at a time into the locked region data buffer, on little endian machines you need to write the 'B' byte, then the 'G' byte etc. This leads to unportable code, and that's why the pixel format RGBA_8888_LE was created. With that format, you should always write the bytes out in little endian (the LE stands for it) despite the byte order of the machine. So if you're using OpenGL, RGBA_8888_LE is a good choice for bitmaps. If you're also using d3d, well, it only runs on little endian hardware anyway, but you'll have to pick something else like ARGB_8888 when using it.