If Iyou need to be able to group/sort foo and bar comments in the same database queries (if Iyou need them to be grouped together or counted as different types of the exact same thing), then you probably need to build the table as one unified comments table. I'll discuss what I'd recommend for that at the end.
If I can assume the comments will never need to be queried as one entity (or that it's unlikely, or that if they do, I can do it by querying each table separately and sorting the results with softwarecode), that would make me lean further toward separate tables.
Even whenWhen using separate (but identical) tables, the database queries to grab them can be built with almost identical code. By using either inheritance, a related model relations, or a shared behavior / helper class (concepts common to many software frameworks), you can create one class to run the same DB queries on each of the separate tables, by simply swapping the database table names that each instance or child of the parent class is configured to use. The table namesname can be a variable/property of the model in the code. In this way you get the benefits of separate tables without having to write or maintain entirely separate code.
Lastly, the more likely and further that I'm potentially going to need to expand comments to BAR and beyond to additional of models, I'm more likely to use a unified table, because it won't require me creating more and more identical tables, which can be tedious to maintain (adding a column to 12 different comment tables is more work than adding it to one).