A small hamburger for a snack? Are you for real? Yes, if you are hungry, this is a perfectly fine snack. Everything is relative of course, and if you are watching your weight you would want to avoid something with so many calories.
If you don't add the mayonnaise to the burger, you are looking at 290 calories. Just a little mayonnaise adds 80 calories (as much as one apple).
I would say that a fast food hamburger is a much better choice than a Snickers bar or Cheetos, or Doritos. You get beef, some lettuce, tomato, and a nutritionless bun, and you will probably feel pretty satisfied.
The reason why I am suggesting it is because there is some nutrition here. In other words, other than the bun, the food included in a fast food hamburger is actually close to whole food.
If you are used to putting away a bag of Doritos for a snack, try a hamburger instead and see if you still feel hungry.
Eating healthy comfort food is better for you than eating unhealthy food. A bag of M&Ms at 240 calories has no benefits to your body compared to a small hamburger.