The exterior walls are thin, maybe 2", so use short screw or hollow wall anchor-type bolts. Screws will work if the interior wall covering is stiff enough, but most RVs have thin luan panels (or similar) so there is only about 1/8" for the screw threads to grab. For that reason, screw anchors, e.g. drywall anchors, or hollow wall bolts (with built in anchors) are recommended.
Don't be surprised if the headboard comes loose after awhile anyway - RVs are subject to a lot of vibration and flexing while traveling.