Can a commercial airliner be used for military purposes?
Retrofitting is (as the comments to your post have already stated) rather difficult and unusual. In addition, the quality of service from such an aircraft you could expect to get would most probably not be great. Analogy: Try changing your minibus for 9 people into minivan for freight and industrial work. 

It is also worth mentioning that the difference in operation is substantial between bombers and commercial jets. You would be better off using something that is not that complicated, like a Cessna Caravan for instance.

I think that energy, time and money would be better spent on building more dedicated aircraft. Changing the commercial ones is also not trivial and will require engineered changes.



It is however fully possible to design a military derivative of a commercial jet. The Boeing P-8 Poseidon is an example of this, being based off the Boeing 737 with the necessary modifications. 

The armament is also fairly extensive:


  5 internal and 6 external stations for AGM-84H/K SLAM-ER, AGM-84 Harpoon, Mark 54 torpedo, missiles, mines, torpedoes, bombs, and a High Altitude Anti-Submarine Warfare Weapon system[