global $post;
$post_cat = get_the_category( $post->ID );
$needle_cat = get_the_category( '1' ); //Taxonomy ID
if ( isset( $post_cat[0] ) && isset( $needle_cat[0] ) ) {
if($post_cat[0]->term_id === $needle_cat[0]->term_id)
{
//you code
}
}