Yes, anxiety can affect your eating. When you have anxiety or stress, then your brain will set off the fight or flight response, which diverts all of your body's resources from the non-essential systems for survival to the essential ones.
So what happens is that there is a shunting of blood from the gastrointestinal system, reproductive system, and skin to the skeletal muscles. Also, the digestive system is shut down so that the resources of the body are diverted to the skeletal muscles, so that your body can prepare to either fight or run. As your digestive system shuts down, then you are not able to eat and your appetite diminishes significantly.
So when you have anxiety or when you are stressed, then this can impact your eating by reducing your intake and reducing your appetite. Indeed, nausea and vomiting are associated physical symptoms of anxiety, so this also contributes to your reduction in food intake and loss of appetite.