You can eat anything you want as long as you track your calories. Your problem is just that you're burning fewer than you take in. If your goal is to lose weight, there is no difference between 1500kcal worth of mars bars and 1500kcal worth of fish, rice, nuts, whatever.
If you can't eat less food by mass, eat lower energy foods - not nuts lmao