Will the wall break and crack if I use nails to fix a door frame?
You will not know until after the fact. Pre-drill a hole the size of the screw shank (#8 wallboard screw should do the job - the length should be sufficient to go 1-1/2 inches in to the jack stud.) This approach will almost never leave you disappointed and will withstand door closing vibration much better than a nail.
Should the graphic be installed on its edge?
The graphic shows two 2x4s installed "on flat". This is okay for a non-load-bearing wall, but for a load-bearing wall the header should be at least two 2x6s with a piece of 1/2" plywood (cut to the same size as the 2x6s) glued between the two 2x6s and then nailed from both sides. The 2x6 (or larger) header is installed "on edge", never "on flat" for a load-bearing wall. The same goes for a window.