If you submitted a federal return prior to April 15 and it was rejected, you have until April 20 to have it corrected and still be considered on time.
If the return is due a refund, there is not a deadline or penalty imposed. The due date is primarily for paying tax due. You can submit a return electronically through October 15 without filing an extension when the taxpayer is due a refund. Taxpayers have three years to claim refunds after that point.
If the taxpayer owes the IRS taxes, they can still have their return e-filed until October 15, but if they did not send the money to the IRS by April 15 they may have penalties and/or interest assessed. An extension allows more time to file without penalties, not more time to pay.
As for the state returns, each state has different rules and it is your responsability to confirm with your particular state, but federal extensions are accepted by several states.