The notes on the piano are arranged in such a way you can easily play them simultaneously. But on the guitar, there are only 6 strings where depending on the fret you are pressing, different notes are produced and the natural notes are arranged horizontally. Thus, it is impossible to play two notes at the same time of the same string.
It will only produce the higher note as the lower note is being covered by the finger pressing on the higher note. But it is possible to play two notes consecutively on the same string and it is even a good practice to help beginners more familiar with the placement of the notes.
It is essential to know how the notes on the guitar are interrelated. Knowing this will make playing the guitar easier. If you start out from any particular note and arrive at it again either up or downwards, you will be one octave away from the starting note.
An arpeggio, which is the first, third and fifth note of a scale played consecutively, generally with one octave at the top, and over one, two three or more octaves. Arpeggios move faster than scales, so they are more of a technical challenge. Only one note should sound at a time, to prevent your fingers from overlapping.