Yes, magnets and other EMI (Electro Magnetic Interference) devices can
affect the functionality of a flash drive. It will not basically harm
the flash drive when it touches it or kept beside a magnet for a short
period of time, but if it happens constantly and if it is kept beside
or on a magnetic device for a long period of time, it may damage the
flash drive.