In the news there is this figure in which they show where EgyptAir plane was over the past 24 hours. Is it possible for ordinary people to do something similar for other flights before booking the flight?
The image shows the source of the information which is flightradar24. Flightradar24 works by utilizing a network of people providing information transmitted from aircraft using ADS-B. You can download apps for Android and iOS that show this information in near real-time. You can also assist in providing this information by purchasing ADS-B receivers which can have nominal cost. I have one that is re-purposed from a USB TV receiver device.
Many airlines do not provide information about the incoming aircraft that is about to service your flight, as this is subject to change, especially at hubs of large airlines. Some American airlines do provide this information in their phone apps or online but this is not very common worldwide.
Other information sources, such as FlightStats, obtain information from government and other sources since flight plans usually need to be filed in advance, although they are subject to change.
Yes, here is the recent history of SU-GCC, the aircraft that was operating flight MS 804 between Paris and Cairo on the morning of the 19th of May. See Berwyn's answer for more information about how that information is collected.
You can see where an aircraft was before booking your flight if you want, but unless you are buying a flight for the same day, it doesn't tell you much. The airline will send its planes wherever they are needed on the day. A plane is not usually assigned to operate a flight until a few days before the actual flight, and it might change if delays or maintenance problems cause other planes to be out of position. Usually the airline doesn't devote one plane to one route, unless it really has to. It will generally only do this if the plane is unique somehow (maybe it has a different interior, or an extra fuel tank for long range operations).
Egypt Air has eleven [now ten :( ] A320s, and they have probably all been to Paris many times.
To add to Berwyns answer.
The BBC have specifically used this functionality from Flightradar24 where you can enter an aeroplanes registration mark and search. Flightradar24 will show the flights from the previous 7-10 days (Date, From, To, Flight Number, Flight Time, STD, ATD, STA and Status) You can even replay flights. Other information includes age of aircraft, type of aircraft and serial number of aircraft.
This functionality is free to be used by anyone.