Assuming that at the time it would be almost appropriate to guess that roughly as many people present understood the English parts as well the Latin bit: Yes, it is perfectly possible that the lack of (language) context might have lead to the interpretation of jelly donut. But this would be a really clueless minority.
Today a note card written in Kennedy's handwriting still counts among the most cherished possessions at Berlin's Kennedy museum. Without it, the people of Berlin might never have figured out what the president was actually trying to say. In red ink and with phonetic spelling scrawled across the page, it reads: "Ish bin ein Bearleener."
Given the larger context of a political speech relating to the wall, the whole situation within the city, the surrounding press coverage, and the fact that in Berlin itself a "Berliner" is not called a "Berliner" it should have been very clear to everyone, so that this misinterpretation would be highly unlikely.
Also, as with so many things in life, context matters! The speech was delivered in Berlin in front of 450,000 people, most of whom I would assume were probably Berliner (no ‘s’ in the plural). It is true that a Berliner is a jam doughnut, but only in certain parts of Germany is it actually called a Berliner. Funnily enough, it isn’t in Berlin. There, it is referred to as a Pfannkuchen (pancake), whereas it’s called Krapfen in southern parts of Germany and Austria. So if JFK had said ‘Ich bin ein Pfannkuchen’, there probably wouldn’t be any room for speculation, but I think we can all agree that it’s pretty clear that he didn’t mean to call himself a pastry.
This rather lengthy preamble of material already answered here in principle is only recapitulated again because no-one seems to bother answering the second part of the question: "and did they laugh?"
Some of the reactions would be called joyous, sure. Then again 'laughing' does not really fit this almost frantic reaction, shown here in a colour video:
"Ich bin ein Berliner - John F. Kennedy's visit to Germany in 1963"
Instead, he made it on the steps of the town-hall of the Berlin suburb of Schoneberg. Something like 400,000 people gathered in the square as he spoke.
And they erupted at the line which resonated round the world. He had been toying with the phrase for some weeks before. He had discussed it with his main speech writer and with people drafted in to help him with his Boston-drawl German pronunciation, which, it is generally agreed, was pretty poor.
Kennedy himself didn't seem to have any concerns over the reaction he met:
The reaction of the crowd listening to Kennedy address them in front of West Berlin's City Hall was so overwhelming that, on the plane leaving Germany, he remarked to his aide, Ted Sorensen, who had written most of his speech, "We'll never have another day like this one as long as we live."
So, despite the general difficulties the crowd present will have had to really understand everything he said and meant on a word by word basis, the reaction of the crowd indicates that the one part they surely understood best they also really understood in the way it was intended.
The origin of this whole misconception seems to be a relatively recent one:
That a former President of the United States should have made
such a fool of himself was too good a story to go unnoticed by the media. It was first presented to a national audience by Newsweek early in 1988 when the magazine printed a letter written by one Kenneth O'Neill of Danbury, Conn.: "To the Germans ['Ich bin ein Berliner'] meant 'I am a jelly doughnut'." Not long thereafter, the New York Times featured an entire article entitled "I Am a Jelly-Filled Doughnut." After telling the story, the author added his own embellishments claiming that the Berliners "tittered among themselves" when they heard the President's proclamation. […]
Of course, no one "tittered"or "chortled"; the situation was too tense for the Berliners to be amused. What is more, every native speaker's Sprachgefühl will tell that "Ich bin ein Berliner" is not only correct but the one and only correct way of expressing in German what the President intended to say.[…]
And the support of the natives before delivering the speech should clear up all possibilities of a screw-up:
Both sentences had been translatedinto German by the man to whom Kennedy gave credit earlier in his address: Robert Lochner, son of Associated Press correspondent Louis P. Lochner, who grew up in Berlin and received his Abitur from the Dahlem Wald-Gymnasium. Lochner has provided valuable insights into how the history-making phrase found its place in the President's address: "It was only a few minutes before the address was to be delivered. When we walkedup the stairs in the city hall, Kennedy took me aside and asked me what 'I am a Berliner'and 'Let them come to Berlin' were in German. I wrote it down for him. He then disappeared into the office of Willy Brandt." Indeed Brandt, in his autobiographic "Begegnungen und Einsichten", reports that Kennedy practiced the German words "while taking a breather in my office."' It was here that he wrote the quasi-phonetic version of the German sentences on his note cards. Immediately before the speech, on his way from the Senate Assembly room to the Rathaus balcony he again asked Klaus Franke, Brandt's personal adviser, to practice "Ich bin ein Berliner" with him.
With this array of native support, it is obvious why the President's German grammar could not be wrong. But what about the claim that the audience misunderstood the phrase because in German the word Berliner can denote a 'jelly-filled doughnut'? This, of course, is total nonsense. In all languages, listeners derive the meaning of homonyms from the context in which they appear.
Seen in this light, those American colleagues who found fault with the grammar of Kennedy's statement can hardly be accused of unprofessional negligence. In the absence of help from the handbooks, it does indeed require the Sprachgefühl of a native speaker to declare John F. Kennedy's "Ich bin ein Berliner" to be correct both grammatically and semantically.
(Quoted from Jürgen Eichhoff: "'Ich bin ein Berliner': A History and a Linguistic Clarification", Monatshefte, Vol. 85, No. 1 (Spring, 1993), pp. 71-80)
A small detail about 'laughter' needs clarification though.
In John F. Kennedy: "Ich bin ein Berliner (I am a 'Berliner')" delivered 26 June 1963, West Berlin, you get a full transcript of the speech. And in the linked youtube video for that you can hear that shortly after he said the words in question which are met with jubilation he also cracks after some attempts a little joke:
Today, in the world of freedom, the proudest boast is "Ich bin ein Berliner." …
I appreciate my interpreter translating my German. (emphasis added)
Only that joke got a bit of a laugh after both Kennedy and the translation was met with bravo cheers and clapping. An impression of the effect with the translator can be heard here (but alas with the crucial first part containing the joke missing). But note that not even the translator deems it necessary to alter the phrase in question in any way.
tl;dr
Neither before, nor during and not after the speech did any German understand this quote as a funny mistake. As also shown by the absence of laughter at him. The theory about this error being possible at all originated apparently long after the fact from a non-native speaker.