Narcotics dogs can detect & alert to anything with a narcotics odor. Since oils are a concentrated liquid version containing THC, it certainly seems like it would bear the odor. Gummies or other edibles, I'm sure the odor is in there. Dog's noses are downright magical how they work and can separate out odors. When we walk into a hamburger joint and have a burger & french fries put in front of us, we might smell cooked meat or fried potatoes. A dog would smell oil, beef, cheese, lettuce, tomato, potatoes, salt, bread (actually flour, eggs, and the other ingredients), and every person standing around... including the ones that left 10 minutes ago but deposited microscopic skin cells around the floor. Excited/stressed people shed skin cells at faster rates and put off a stronger odor is picked up by the dog even more.
As long as you have a legal prescription and are transporting your medical THC product in the approved fashion your state requires, then you should be fine anyway. And most of the time, otherwise law-abiding folks will not find themselves in situations where narcotics dogs are being utilized.