Both of those items are supplements, meaning they supplement (add to) your diet to fill in the gaps.
- Pre-Workout is for providing you with energy required to workout harder (and potentially: have a bigger pump, recover faster, synthesise muscle mass better)
- Mass Gainer is just that, it is a powder containing lots of calories, usually in a lean, high protein, form.
As both are supplements, you are fine to take both alongside a nutritionally rich diet.
HOWEVER you should know what is in your powders. Hopefully, you wouldn't just eat anything you were given by a stranger and especially not if it is in powder form.
The website you can look up MOST powders on is labdoor.com
Here are some of the labdoor articles for MuscleTech's products,
I am going to go out on a limb and guess that your pre-workout is the same brand as your mass gainer (muscle tech).
For example:
In a surprising finding, MuscleTech NITRO-TECH contained over 1000mg
of taurine, or more than 2x the taurine content in a Red Bull. In
known clinical trials, Taurine content of 1000-9000mg has been
analyzed for energy; early data is positive but inconclusive.