Whenever I watch 'Smallville', I wonder how the writers take us back and forth the timeline without getting into a conflicting situation. Another example would be 'Back to the Future' trilogy. Also, when they do a sequel, they don't really insert elements which are supposed to be in the prequel. Say, a flashback from the father about his father!! If I try extending my story, it either goes boring (with flashbacks) or it ends up in a conflicting situation (with the original story). Are there any rules that we should follow while writing the original story so that we get a good amount of freedom for writing Prequels and Sequels? Thanks for helping.
There are no rules; there is only what works, and you have to be the judge of that. But there are aids. Whenever you write multiple works using the same characters, you should keep a concordance. This is a set of notes about characters and plot points, which you can refer to later when you forget what color hair a character has or who said or did what to whom.
You should always keep such notes and refresh them after each chapter or section. Modern software such as Scrivener automates the process, making it pretty easy. Tag your notes for cross-referencing. That way you never have to come adrift.
As for the "boring" problem, that is something a concordance won't help. There is nothing wrong with writing flashbacks (or flash-forwards) so long as they advance the current story. But remember it is the current story you should be concerned with. Keep the flashbacks lean and pointed if you can. To suggest something in a few words is better than beating it to death in several chapters or scenes. I don't know if you watch Breaking Bad, but the opening of the current season has a flash-forward of the main character, Walter White, one year hence. He's in a Denny's, sardonically "celebrating" his 52nd birthday while he meets up with a man who is selling him an M-60 machine gun. It's a couple minutes of film, but it raises all kinds of questions in the viewer's mind. White is a scientist, not a thug — why does he need a machine gun? Why is he celebrating his birthday in an ironic echo of the way he celebrated his birthday a year earlier (the flash-forward has him mimicking the way he arranged bacon strips to form the numerals of his age in Season One, which will not escape the avid viewer's notice — and thereby suggesting a flashback within the flash-forward). We are at once wondering about his future while contemplating how far he has come from his past. If you can do that sort of thing with your outside-of-timeline writing, you will be deepening and enhancing your present narrative.
Sketch out your entire timeline before you write your story. Have an idea of what happened before and after. Your book takes place in medias res, in the middle of things. If you decide what your entire history is, then you won't develop conflicts in your flashbacks and you won't step on the future, because you'll already have a linear series of events to refer to.