Yes, it's within Yosemite National Park, but it's farther than you think from the Valley where all the main "easy" access views are. Just remember that as the sun is setting and you haven't left the valley yet -- you don't want to have to set up camp in the dark.
Amazing surfing just down the beach from here at Otter Rock! Try and be in the closer loop to the ocean, or you'll be walking quite a ways to the beach. They also offer first come first serve spots for cyclists.