Did any of the 66 Barracuda's come with a 318?

Ok, here we go. In 66, if you got the 235 hp 273 4 bbl, it would be on the fender tag under the “ab” as “32”, but in the VIN, the 5th character only identified the engine size. In this case the “D” designates the 273, not which HP the 273 was, that was on the fender tag.
Absolutely correct...same for the "G" code in 66 which could be a 383 with 2 or 4 barrel.
You need the fender tag or build sheet to determine which version engine your car originally had.