Yes, you can use Fire Bolt while being underwater in D&D 5e. Magic sometimes behaves outside the normal laws of physics; thus, someone can use Fire Bolt while underwater. It can hit its target and cause damage. Still, it is unlikely that flammable objects hit with Fire Bolt underwater will burst into flames. The flames produced by the Fire Bolt will most likely be extinguished immediately by the water.