In the original Star Wars, the Millennium Falcon escapes because Darth Vader convinces Grand Moff Tarkin to allow it. The ultimate strategy is to track the ship to the Rebel Base.
TARKIN: You're sure the homing beacon is secure aboard their ship? I'm taking an awful risk, Vader.
Shortly thereafter, Princess Leia suggests they're being tracked, and Han is his usual cocky self in responding:
LEIA: They let us go. It's the only explanation for the ease of our escape.
HAN: Easy? You call that easy?
LEIA: They're tracking us.
HAN: Not this ship, sister.
Obviously Han is wrong, but why is he so sure he's safe from being tracked?
Why would the ship make any difference to the Empire's ability to attach a homing beacon?
In Episode II: Attack of the Clones, we see how easy it is for Obi-Wan to attach a tracking device to Jango Fett's ship. He simply throws a disc at the ship, and it sticks to the outer hull.
As a smuggler, shouldn't Han know about the technology behind "attachable" tracking devices?