A BitTorrent client learns its actual IP Address through port mapping protocols. It uses NAT - PMP, PCP and uPnP for external IP Address discovery.
To join a torrent, a client sends an announce message to the
tracker that maintains the list of all peers in that torrent. This announce message contains an optional parameter, the IP address of the interface from which a client sent the message according to the BitTorrentSpecification#Tracker_Request_Parameters.
According to this research paper, this behaviour was seen in µTorrent, BitSpirit, and libTorrent. I think now this optional parameter is left empty and completely ignored by the tracker servers. They also found that Extension protocol handshakes might also contain the user’s IP address. Tor can't help if you anonymously send deanonymizing information about yourself.
While this kind of deanonymizing information can even deanonymize a client behind a VPN, I think this is no longer happen since the BitTorrent protocol has been gone through various enhancement protocols. It was a problem when this research paper was published but it doesn't happen now.
Today, the only threat which happen on Tor but not on VPN is if a client uses DHT. DHT runs on top of UDP to find peers in a torrent and Tor does not support UDP at all. So a DHT client can communicate directly to the other DHT nodes by completely ignoring the Tor circuit. This was the case by default with µTorrent. This answers your question why is VPN safe for BitTorrent but not Tor. This is still a problem if you use BitTorrent over Tor with DHT enabled.
An application can completely ignore the Tor circuit and communicate directly with its actual IP Address if it is not configured to use Tor. VPN routes entire traffic of your PC by creating virtual adapter. If flash is not configured to use Tor, it may nit see the Tor circuit.