Are the Taliban and Hamas the same?

No. Although there are many similarities between the two Sunni Islamist Paramilitary organizations, they have different organizational structures, political aims, fighting styles, and different leadership.