These answers are contradictory basically because none of them are getting down to the real meat of the issue.
That is, it depends if the programmers accounted for it or not. The ease of doing this will also vary by console, as well as how severe the consequences if programmers didn't.
Here are a few examples.
(To simplify things I will generally assume that PAL is synonymous with 625 line (576i) @ 50Hz systems, and NTSC with 525 line (480i) @ 60Hz systems, but I am fully aware that there are a few exceptions around the world that use one colour standard with the other resolution/frequency standard.)
Atari 2600
The video chip on this console works on an incredibly low level. However, running an NTSC game on a PAL console or vice versa will often technically work; but it will produce a signal that is technically not either a standard PAL or standard NTSC signal, though some TVs will take it (if you're curious, it'll produce PAL colour but at 60Hz/525 lines with an NTSC cartridge in a PAL console, or NTSC colour but at 50Hz/625 lines with a PAL cartridge in an NTSC console). This is because the vertical blanking intervals — the signals that tell the TV "that frame's over, time for the next one" — are generated by the game code, and usually Atari 2600 code is so time-constrained that the authors wouldn't bother adding time-consuming checks for PAL and NTSC (I don't even know if such checks are technically possible).
In addition to the timing issues, the colours will also be wrong, as again the hardware uses a very primitive means of generating colours in either PAL or NTSC, and they don't exactly line up with each other. The PAL versions of some games might choose to correct this, or they might not. SECAM colours are so complicated that Atari just gave up and produced an incredibly reduced colour palette for the SECAM world (France/USSR and allies); so some games are unplayable without special SECAM versions thanks to this reduced palette.
8-bit home computers
The 8-bit home computers, as popular in the UK and Europe but less popular in the US, usually had little thought of compatibility put into them. So it can be very hit or miss whether a game will play flawlessly, play OK but with glitches, or not play at all, when transferred from region to region. Again, differences in the video timing are to blame; while with these computers generally the video signal is not generated in code like on the Atari 2600, code of this era was still heavily timing dependent, and so certain parts of the picture generation taking longer or shorter than the code expects can wreak havoc.
NES/Famicom
By this era, the problems of incompatibility from a logistical standpoint were starting to be recognised. Especially with the NES often having two ROM chips per game, wouldn't it be easier if those chips were the same everywhere, with the only difference inside the cartridges being the region lock-out chips? So with this console, many (not all) games will now "work" on both NTSC and PAL, and the same code will be shipped in both regions. However, usually this involves some severe compromises — the PAL version, often considered as an afterthought thanks to the enduring popularity of the 8-bit home computers and little appetite from the public to move onto console gaming at the time, would run "letterboxed" (with coloured bars on the top and bottom of the screen), due to not making use of the extra visible lines (576 vs 480) available in most PAL territories, and the game itself would run noticeably slower (synchronised with the 50Hz as opposed to the 60Hz TV signal).
Mega Drive/Genesis
By this era, games were not only more likely to use the same ROM chips in PAL and NTSC territory, but were also starting to have checks programmed to change the timing and the resolution to try to provide the same experience on both systems. This is in part due to this console generation being the first to really make a sizeable dent in Europe; the 8-bit computers were long in the tooth by now and many people hadn't upgraded to the 16-bit computers of the era. Not every game does this — perhaps most infamously for European customers, Sonic the Hedgehog would run slowly and letterboxed on PAL systems.
Nintendo 64/PS1 and beyond
By this point, there was usually very little reason not to code the game to be compatible in both regions; the amount of extra space and time used on a given copy of the game was negligible compared to the savings of having one codebase to run in all regions. However, this was the era when we started to really see large numbers of games come with translations into many of the most popular European languages. As such, things were really starting to diverge again in terms of what got shipped to each region — but this is now for cultural/social reasons rather than technical ones.