What do you mean about an irregular heartbeat? Could you be detecting a sinus rhythm? It is perfectly normal for a dog's heartbeat to increase when they inhale, and decrease when they exhale.
Dog?s Sinus Arrhythmia Heart Rhythm Is Normal
If that is what you are describing, you are very perceptive, most people don't notice.