Medicine while pregnant

Can you take off brand medicine while pregnant? I know you can take rubituasin DM whole pregnant for a cold but can you take the store bought brand?