Yes. You don’t even need a trunk. If all ports on both switches are access ports on Vlan 3, then the port connecting the two switches are on Vlan 3 and both switches form one broadcast domain on that Vlan.
If switches are unmanaged then all ports would be on the one Vlan and the number is irrelevant.
A couple helpful details:
Access ports to end hosts or routers should have portfast enabled, but access ports interconnecting switches should not.
Two switches on one Vlan is common for redundancy, but in that case you want two connections between them. Ideally the two connections would be etherchanneled to optimize bandwidth and failover (as opposed to relying on spanning tree to avoid loops).
Under some circumstances (same VTP domain) Cisco switches automatically form 802.1q trunks when you connect them together.