The Belgian striker has been widely tipped to be on his way out of Old Trafford this summer after falling down the pecking order under Ole Gunnar Solskjaer.
Should the 26-year-old exit the club, it would leave the Red Devils looking for reinforcements up front.
And former West Ham United and England boss Allardyce seems to think that ex-Chelsea FC striker Costa, 30, would be a great fit for the Premier League outfit – but only if Lukaku does leave.
Speaking in an interview with talkSPORT, as quoted by the Daily Express, Allardyce said: “[If I were Manchester United boss, I would not sell] Lukaku, no.
“Not unless I was getting Costa. I might say yes to that.”
Costa scored just two goals and made two assists in 16 La Liga games for Atletico Madrid last season.
Manchester United are believed to be on the lookout for a number of new signings this summer as the Red Devils look to strengthen their squad ahead of Ole Gunnar Solskjaer’s first full campaign in charge.
So far, they have only landed Daniel James and Aaron Wan-Bissaka ahead of the new Premier League campaign.
Manchester United finished sixth and without a trophy in what ended up to be a disappointing campaign last term.
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news