How to get bbpress sticky topics

You can make the query like above using following code.

<?php
query_posts( array( 'posts_per_page' => 2, 'meta_key' => '_bbp_sticky_topics',  'post_type'=> 'topic', 'order' => 'ASC' ) );
if (have_posts()) : 
    while (have_posts()) : the_post(); 
        //do something
    endwhile;
endif; 
?>

But i strongly recommend you not to alter main query using query_posts() and instead use WP_Query as following.

<?php 
$query = new WP_Query( array( 'posts_per_page' => 2, 'meta_key' => '_bbp_sticky_topics', 'post_type'=> 'topic', 'order' => 'ASC' ) );
if ( $query->have_posts()) : 
    while ($query->have_posts()) : $query->the_post(); 
        //do something
    endwhile;
endif; 
/* Restore original Post Data */
wp_reset_postdata();
?>