Your house will be protected from fire hazards through circuit breakers, which cut the electricity if there is overloading. If one of your circuit breakers trips, it will cause the power to surge, which can cause your lights to flicker.
If something like this occurs, you must examine the breakers of the electrical panel to determine whether any circuits have indeed been tripped. If so, simply reset the switch, and the problem should be resolved. If your lights continue to flicker after resetting the breaker, you may have a more serious problem and should call an electrician.