You can eat junk food on a calorie deficit because calorie deficit works independently, regardless of the type of food you choose to eat. However, for the long-term results, eating only junk food won't deliver all the essential nutrients, therefore it can make you feel progressively worse.
More useful articles on a similar topic 👇
Does eating chips make you fat?Can I eat chips while losing weight?