Yes, your BP definitely can go up when you are fighting infection. I don't know what you mean by 'through the roof" though. If it's dangerously high, like a real hypertensive crisis, then obviously you should call your doctor.
What readings do you get when you have a cold or flu?