Is there a good way to set the logic to prevent a lead from receiving duplicate content in an engagement program? For example, if a leads downloads content x via a 3rd party vendor and enters our database, is there a way to prevent that lead from receiving the cast that offers content x?
Yes, it is possible if the contents in your engagement program are programs and not simple emails. You will be able to control the fact that they have already got a content though program membership. See here : Add Content to a Stream - Marketo Docs - Product Docs
What if they receive the content through a 3rd party site and I just import those leads into a program? They will become a member of that program but didn't receive the content from that program.
If you import them as members of the sub program, the Engagement program will consider they have received the content and will not send it twice.