Can I use screws for attaching a ladder to a bunk bed?
Yes. 8 high-quality gold or stainless (not black oxide) construction screws (two at each connection point) with at least 1-1/2" penetration will hold with more than enough strength for even a typical adult. 

In this case, use 3" or 3-1/2". Torx are much nicer to work with than Phillips. Pre-drill 3/4 of the screw's length and the diameter of the screw shank.