Ciao Tamatha!
I'll try to explain to you as well as I can.
The word you heard, "prego", could be used in different ways.
One way is like "you're welcome" as in "Grazie / Prego "
One other way is if you ask me something, e.g.: "please could you give me that newspaper?" then I would bring the paper to you and I am surely going to tell you: "prego" as "please, take it".
The same happens in shops, maybe they told you "prego" when giving you the change as in (please, take your change) or when giving you something e.g. shop bags, or opening the door to help you getting out to the shop as in "please, here the bags" or "please, this way".
So in these cases, if someone keep the door open for you and says "prego", the answer should be "grazie".
Sometimes "prego?" is also a question as if you say something and I don't understand, it's probably that I'm going to tell you: "prego?" as in "please, could you repeat?" (this depends on where you are and whith whom you are talking to, in most of the cases people says "eeeeh?" or "cosa?" as in huh? and what?)
In fact, it's kind of difficult to explain literally (paradoxically I could explain better in japanese because they have the same formula

) but anyway, "prego" is a courtesy word that implies respect to the interlocutor.
I hope this helps. ^__^
Be the change you want to see in the world.