Any country can declare war on anybody else. What matters is can you back it up?
No army in any western country can declare war.
In both.
germany
no
Austria-Hungary.
Pearl Harbour.
Germany
On Japan.
yes
The Austrian-Hungarians were first to declare war with the Serbs.
The United States was bombed by the Japanese at Pearl Harbor which cause a declaration of war but Germany had an alliance with Japan and it had forced the United States to declare war on Germany too. Then Germany had an alliance with Italy which cause the United States to declare war on yet another country. Then the world was at war and therefore World War 2 started.