OK, my marketing side is coming out here. As I have mentioned in the past, if you contribute to the public good in your own name, great, but if you are doing it in the name of your business, it should be a form of advertising; encouraging people to use your business.
In terms of homeless shelters, there are two problems involved. The first is that homeless shelters are a major NIMBY issue; while people, in general, are in favor of providing food and shelter for the homeless, they don't want it near where they live (consider that, while many homeless people are good people down on their luck, a good chunk of the homeless problem is due to the trend to, as a money saving measure, move mentally ill people from state institutions to local community services, and then not using any of the savings to fund the community services, leaving the mentally ill people pretty much on their own). Secondarily, there is an association of homeless people and shelters with a lack of sanitation; there is a disgust factor if people think they are eating the same food as the homeless people do.
Therefore, I do not think that publicly helping out homeless shelters would be good for a food business, particularly a street food business (where you already have the "unsanitary" stigma working against you).
Another problem is on the other end of things. Food donations to homeless shelters are not treated as extras; those funding the homeless shelters reduce the budget for food based on those donations. So, in effect, food donations are not going t the homeless as much as they are going to the taxpayers, and result in a less healthy diet for those in the shelters (especially as a lot of the donations are in the form of relatively unbalanced snack and treat foods, and, at the risk of offending many in this group, hot dogs are not the healthiest food on earth).
Having a donation jar for local causes may well be a good idea for a cart, but try to match the cause to one that will give the underlying message to the customer, "I really want to buy a hot dog from this cart."