A smaller format can use a larger pinhole, of course, but that increases the focal length. If you read the responses above, the focal length of the pinhole is determined by the diameter of the pinhole. The larger the diameter, the longer the focal length.
You can use any size hole you want on any size format, but your ability to actually form an image depends on the combination of the size of the hole and the distance from the film. The table about shows examples for the best resolution/clarity -- to create an image AND avoid diffraction. If your pinhole gets wider, you lose image formation. If your pinhole gets smaller, you get more diffraction..