The law requires federal agencies to buy domestic products. But federal agencies can buy foreign products sometimes, e.g., when domestic items are not available at a reasonable cost or when international trade agreements waive the Buy American Act restrictions.
According to the federal procurement database, foreign products comprised less than 5% of what the government bought in fiscal year 2017. The real amount could be higher than that, in part, because of data errors. For example, some agencies had inaccurately recorded waiver information.