Even though a swimsuit can be used as undergarments, it is not suggested. Long-term use of a swimsuit can cause skin irritation and make it unpleasant.
Underwear is designed to be worn for long periods of time and is comprised of breathable, moisture-wicking fabrics that are soft to the touch and comfortable to wear. Further more, underwear is less expensive and lasts longer than a swimsuit used as underwear.
What about using underwear as swimsuit, is it advisable? It depends. It is not recommended in general. The majority of swimming pools have some sort of swimsuit regulation.
The bulk of them insist on you wearing a proper swimwear and don't allow you to wear underpants or street clothes. Those policies are largely in place for the sake of safety. Outside clothing can spread waterborne sickness and make other swimmers ill.