It can happen, water gets past the seal and then sits, causing corrosion over time. If the top doesn't get removed, then it doesn't ever dry out, and corrosion forms.
If that's the only place there is rust, you can try to patch it. Many people consider cap corner/windshield pillar rust to be a death knoll and end up replacing the cab. If the rest of the body is really good, it might be worth fixing.