It doesn't sound like it was a big deal, just that the two of them got into quarters that were a little too tight. I think it is a really, really good sign that all that happened was that they both got startled - Sam did not growl or nip, he just wanted out of there.
I like flvegan's suggestion that you cover Sam's crate so he can go in there if he likes. I would also keep the desk chair pulled away from the desk when you are not sitting there - that way if your son approaches while Sam is under there, Sam can get out without commotion.
My Golden Retriever, Ben, is shy of all people, but particularly afraid of kids. The level of his fear suggests to me that he had some scary interactions with kids before I got him from the rescue. Even the sweetest child sometimes moves fast, talks loudly, grabs a tail or ear, or hugs too tight - making a shy dog feel trapped. Ben isn't slightest bit afraid of loud thunderstorms - but a 3-year-old girl who wants to pet the puppy is reason for terror.

Ben will never react with defensive aggression, but for his sake I avoid little kids when we are at the park. When I have friends with kids visit, I let Ben hang out on the bed (where he feels safe) and put up a baby-gate to keep the kids out of the bedroom.
Ben does best with adults who ignore him and let him approach them. Getting your two-year-old son to do this will be very tough - but I would encourage him to continue to play with your other dog and to ignore Sam. This is actually a pretty good lesson for your son - you want him to learn to not approach dogs that are reacting with even subtle signs of fear because some might react with defensive aggression and because your son is more likely to enjoy interacting with animals as he becomes able to discern how they feel and react appropriately. It is a nice lesson in empathy.
It sounds like things are going pretty well with Sam - all in all - it takes a long time for a new furkid to be thoroughly integrated into the household.
