I’ve built and restored wooden boats and timber frame buildings and still do when the opportunity arises and as spc above quite correctly says, wooden pegs are used in timber framing. I’ve never come across a boat where pegs are used to fasten structural bits together, although wooden pins were used for numerous other purposes.
Older sailing vessels would have belay pins, typically made of wood. These would be used to tie or secure the various bits of standing rigging and running rigging, such as the halyards and sheets or the ropes that pull up and control the sails. Usually, these belay pins would be attached by hammering them through a hole in and to the Bulwarks, which themselves ran fore and aft along the sides of the boat (attached to the Gunwhales). So a series of holes would be seen in this part of the boat.
If you can also see a mortice socket in the timber, through which the holes go through, then it is more than likely a bit of timber from a house.