Both were points of conflict in the Cold War. Both were perceived attempts of Soviet aggression against American interests. The Cuban Missile Crisis was viewed as a direct threat to the United States as the Soviet Union had long-range missiles in Cuba. The Vietnam War was viewed as more of an indirect threat as the United States fought it using the domino theory which stated that if one country fell to communism, others in the region would follow it.
Both the Cuban Missile Crisis and the Vietnam War involved the United States backing regimes that were not popular with the people of those countries. The United States backed the anti-communist Batista in Cuba until his overthrow by Castro. Castro then literally embraced Soviet premier Khrushchev and allowed him to build missile silos in Cuba. The United States also backed the anti-Communist leader Diem in South Vietnam who was universally hated by most of his own people for his rule resembling French imperialist rule rather than local Vietnamese culture. The war escalated when Diem was assassinated and North Vietnam increased its attacks under Ho Chi Minh who, while a communist, was more popular than Diem.
Both conflicts involved heavy involvement by both the Soviets and the United States. The Soviets stationed missiles in Cuba and sent Castro aid for years. The United States tried to overthrow Castro in the disastrous Bay of Pigs incident which led to the Cuban Missile Crisis as the United States looked weak at the time. During the Vietnam War the North Vietnamese used a lot of Soviet weaponry and Soviet advisers helped to make sure that the North Vietnamese capital, Hanoi, had a strong air defense system. Just like the stakes were high during the Cuban Missile Crisis as both superpowers teetered on nuclear war, there was always a worry that a Soviet adviser would be killed in Vietnam and thus escalate a regional conflict.
Finally, both conflicts did nothing to roll back communism. Cuba remained a communist nation for decades and the United States still has poor relations with the country. North Vietnam eventually overran South Vietnam after the United States pulled out of the war.