Looking at the state-by-state results in 1856, if you make the generous assumption that Fillmore (Whig) would have gotten every Fremont vote in addition to his OTL votes as the Know-Nothing/Whig fusion nominee, Buchanan still would have won. The only states Buchanan won with less than 50% of the popular vote (apart from South Carolina, which didn't have a popular vote for President) were Illinois, New Jersey, and California for a combined 25 electoral votes. That would leave Buchanan with 149, exactly the total he'd need to win. Buchanan would have lost the popular vote in this scenario, by a pretty big margin: I'm guessing because the census was six years out of date and many of the western states had gained a lot of voters since 1850.
But you asked about 1852, which had a different political environment than 1856. Still, Pierce won by a pretty convincing margin in 1852 (7% of the popular vote, almost all of the electoral votes, and about 6.5% in the electoral tipping-point state). Buchanan would have needed to be a much weaker candidate than Pierce, and Fillmore a much stronger candidate than Scott, in order to swing that margin.