Why must one wait 48 hours to fly, after scuba diving?
Yes It's true. And yes it's related to pressure. 

Have you heard of "The bends" or decompression sickness? 

As divers go deeper the pressure increases. The longer you dive and deeper you go the more nitrogen is absorbed into your blood as a dissolved gas. As you return to the surface the pressure reduces and the nitrogen reverts to a gas.

This decompression needs to be done slowly so the nitrogen can pass back out through your lungs.  If you ascend too fast the nitrogen can form bubbles in your blood (Just like when you open a bottle of coke.) which can be painful and possibly fatal. 

Even once you have finished diving you will still have residual nitrogen in your blood which will take time to release.

Air pressure reduces further when you fly. If you finished a dive and got in a plane the rapid climb in altitude would result in a drop in pressure similar to a rapid ascent while diving. So you would run the risk of getting the bends.

Small planes aren't pressurized. But even pressurized planes might not maintain atmospheric pressure when flying.

This topic should have been covered if you have taken a dive course.