It depends. Optimally yes- random encounters can add a lot of depth and plausibility to a game world, and let the characters know they are not the only active participants. In most of my games that last for any amount of time, I use them, and present them as asides to the main plot, which lets the players know that there is no linear path I want the PCs to take. About 50% of my random encounters are immediately hostile, 30% are cautious, and 20% are friendly. I also don't give out XP based on killing stuff, but rather on roleplaying and accomplishing objectives, so throwing out a few random encounters doesn't upset XP progression in the slightest.
However, in short term (less than 6 session) games, I don't tend to use them since they do take up a decent amount of time, and with limited time I'd rather focus on the plot.