I’m probably not the right person to answer your question as I play almost exclusively by ear. I know very little about music theory and all the rules and regulations of what chords, scales and notes go where. My theory is… If it sounds good and sounds right, it works.
Sometimes in Bluegrass or other genres, musicians will throw in a quick A chord before moving to the D chord to change it up a little. Makes the song more interesting. This is in the the key of G of course, as you mentioned.
To answer this question… Yes it’s okay to break the “rules”. Music is something we listen to, therefore if it’s pleasing to the ear, it must be right.
But please, don’t stop learning music theory! I wish I had more knowledge and had taken the time to learn more. My suggestion would be to use it as guide and not take it too literal. Combine what you learn in theory with what your ear tells you and you’ll become much better as you go along.
One more thing… Be creative. Try things that don’t make sense, you never know…
I hope this helps and I didn’t confuse you even more. Hopefully someone with a better knowledge of theory can give you a better answer,