Do airlines or immigration officers verify the validity of visas(forged or real one) electronically when we are travelling from an african country to Schengen area, Canada or USA?
The US, Canada and several Schengen countries require passenger information be sent prior to departure so the answer is, yes, they can verify your Passport and Visa.
Whether they do is entirely up to them.
Seems Emirates has the most current list of countries that require this. It's generally called APIS (Advance Passenger Information System).