|You have to use a bit of common sense with dents — small dints in otherwise new and undamaged cans may be fine. However, cans that are damaged enough to let air in are extremely dangerous, and even a small dent could be enough to damage the seams where the can is sealed. Since you can’t tell for sure, it’s safer not to eat from a dented can.
Rusting can happen when cans aren’t stored in dry enough conditions, and a small amount probably won’t damage the can enough to affect the contents. If there’s a lot of rust it’s safest not to use it. Food from a bulging can should definitely not be eaten.