Astronauts can swallow food in space because
The swallowing process forces food into the stomach
The process of swallowing food and its further passage through the digestive tract is due to a process called peristalsis. Peristalsis is the alternate contraction and relaxation of the digestive tube creating a wave-like movement. Such a movement is caused due to the presence of muscles in the wall of the tube. Hence even if the astronauts are travelling in space, peristaltic waves occur in the digestive tract as it is not under the control of gravity.