If you are poor living away from the beach, it's perfectly natural that you spend your entire childhood without even seeing the beach let alone learning how to swim. Thailand is not an island.
I live in a landlocked country and nearly everyone I know can swim. People usually swim in public pools, lakes or ponds. Swimming is also very often part of the PE middle school curriculum here.
Good of your country. Many cities in SE Asia have none of three. If you are in upper middle class, you can afford private swimming pool membership. Less then .1% schools have swimming pool. Rivers are polluted enough and have no infrastructure in place for swimmers.