usually those ballasts are purchased to replace a bad ballast in a fixture. its best to have an enclosure of some sort to install the ballast. if the ballast or the wire connections ever spark, then an enclosure would contain the spark making it safer imo.
but some people use these type. i would mount it on a metall plate or something not flamable but still an enclosure is best. yes an extention cord would work but you will need to cut off the female end and connect the wires to the ballast. use a good extention cord and not one of those little ones you get for a table lamp or xmas treelight lights
search around some of the diy threads and im sure someone has used these and maybe has some pics in the thread.