How do if all posts has this category ID then do this

You can use get_category( $id ), the object it returns includes a count of posts contained in this category.

To build on your example, this would be:

$my_category = get_category( '25' );

if ( 1 <= $my_category->category_count ) {
   echo "OK";
} else {
    echo "NO OK";
}