Whether you are using a hard plastic carrier that goes in the cargo hold or a soft carry-on carrier that you can fit underneath your seat, you need to be sure that the carrier is the proper size for your dog. According to Southwest Airlines, the dog must "be completely inside the pet carrier and be able to stand up and move around the carrier with ease."
If you choose a pet carrier that will be stowed in the airplane's cabin, it must be able to fit beneath the seat. Southwest Airlines helpfully provides dimensions for the seats that can help you choose the proper carrier. A window seat measures 19 inches length by 14 inches width by 8.25 inches height; a middle seat measures 19 inches length by 19 inches width by 8.25 inches height; an aisle seat measures 19 inches length by 14 inches width by 8.25 height. As long as the travel carrier for your dog falls within these dimensions, your pet carrier would be considered approved by Southwest Airlines. Dimensions for seats on other airlines may differ.
One detail that the airlines focus on is security. The animal must be contained within the carrier without one portion of it sticking out. When you have a dog carrier that's stowed in the cargo area, you should add additional security by wrapping bungee cords around it to make even more certain that the door won't accidentally open en route.