Friend, the dark color stool is likely the result of bleeding in the upper gastrointestinal tract. You are right to suspect ulcers as a possible cause. But, in dogs they are usually not caused by stress instead we need to consider things like: Infections, ingestion of a foreign body, parasites, tumors or even part of a systemic disease. Doing an endoscopy is an excellent idea to determine the exact underlying cause. Cost varies between clinic and states but you are looking at around 200-300 dollars. Prior to going for endoscopy I would just have family vet examine him and do some xrays, fecal analysis and blood work as initial screening test. In the meantime this is what you can do:
1- Do not give things like Pepto Bismol or imodium. Start him on Pepcid AC (famotidine) 10mg tablet every 12 hours. You can buy Pepcid AC over the counter in any pharmacy.
2- No food or water for 6-8 hours. Need to give his gastrointestinal tract time to rest. Keep him indoors in a cool room when fasting.
3- After 6-8 hours offer a small amount of water. Wait half hour, if no vomiting, offer small amount of rice (50%) and boiled boneless chicken or ground beef (50%) 4-6 times a day.
4- Follow up with your family veterinarian for a hands on examination.
My goal is to provide you with excellent service - I hope I've provided the information you were seeking, if you feel you have received anything less, please reply back as I am happy to address follow-up questions. Kindly rate me when you are done.