These days I don't think either is a likely cause of card corruption, but you should always format cards in the camera whenever possible because some manufacturers interpret small aspects of the way data is placed on a drive differently.
Here's what you should avoid if you want to avoid card corruption:
- shooting bursts of frames with too slow a card for the camera
- shooting right to the point where the card is filled (especially in bursts)
- (3) shooting video until the card is full.
#1 has a tendency to cause the write controller in the camera to get stressed and miss a beat. #2 is even trickier because of the way card space is calculated on the fly by the camera. #3 is problematic because video compression is being done by the camera in real time, and sometimes there's less space left than the camera thought when it decides it had better save what it's got to the card and stop the video recording.