I would argue that the similarities that exist between the two events are largely based on different groups' reactions after the initial incidents. Below are several similarities, because I see from the other answers that you already have many valid differences:
1. The Gulf of Tonkin incident and the attack on 9/11: In 1964, US ships were allegedly attacked on two different days in the Gulf of Tonkin by North Vietnamese forces. When the second attack occurred (there is still controversy about what actually happened), President Johnson was granted power by Congress to defend any Southeast Asian country that might come under attack as we did in the Gulf. This decision eventually led up to the significant number of US troops deployed to Vietnam. Immediately after the attack on 9/11, President Bush announced that the US would retaliate and soon sent troops into Afghanistan where Osama bin Laden (who claimed responsibility for the attacks) was last known to be hiding. At the time, similar to the Gulf of Tonkin Resolution granted President Johnson which showed Congress's support for some military action, the US Congress was solidly behind the President sending troops into Afghanistan. However, public opinion and much of the support in Congress have waned over the past 9 years to the point where some are calling for a complete withdrawal from Afghanistan just as many called for a complete withdrawal from Vietnam.
2. The conflict in Vietnam and the conflict in Afghanistan (a result of the 9/11 attacks) do have quite a few similarities. US and NATO troops do not really know whom to trust in Afghanistan just as Americans did not know whom to trust in Vietnam. When different sects of a country are fighting against one another and a foreign element is introduced, the indigenous people of the country have to try to figure out which side to take--not an easy thing to do when you consider that you might be on the wrong side at the end of the conflict and end up being punished for your earlier decision. Similarly, the conflict in both countries mainly involves guerrilla warfare, especially on the NVA's and Taliban's part. The US has had to adapt to situations where its modern technology does not always work the best in a rugged terrain which the enemy knows thoroughly.