Can you be treated for peptic ulcers without having an endoscopy?

Yes with PPI . but better to know whether that is indeed what you have!! so should have an EGD. but proton pump inhibitors (any of them, really) work well to heal ulcers.
Endoscopy for ulcer. Yes you can be treated if there is evidence of ulcer on upper GI series which involves radiation.You can also diagnose clinically by history, physical exam and urea breath test for h pylori.It is then treaed with combination of antibiotics and Omeprazole or another proton pump inhibiter.But endoscopy is the gold standard these day, as ulcer can be seen and biopsied and h pylori tested.